RPM安装httpd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# yum -yinstall httpd
//安装httpd会自动安装一下依赖包:
apr
apr-util
httpd-tools
mailcap
# rpm -qi httpd
Name       : httpd
Version    : 2.4.6
Release    : 18.el7.centos
Architecture: x86_64
Install Date: Mon 11 Aug 2014 02:44:55 PMCST
Group      : System Environment/Daemons
Size       : 9793373
License    : ASL 2.0
Signature  : RSA/SHA256, Wed 23 Jul 2014 11:21:22 PM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : httpd-2.4.6-18.el7.centos.src.rpm
Build Date : Wed 23 Jul 2014 10:49:10 PM CST
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager   : CentOS BuildSystem <http://bugs.centos.org>
Vendor     : CentOS
URL        : http://httpd.apache.org/
Summary    : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful,efficient, and extensible web server.

修改配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cd
/etc/httpd/conf
# ls
httpd.conf 
magic
#cp httpd.conf httpd.conf.origin    //将原有配置文件备份
# more httpd.conf
//查看配置文件,我们注意到以一配置:
DocumentRoot"/var/www/html"
  
//特别是要注意这个配置
//这是Apache 2.4的一个新的默认值,拒绝所有的请求!
  
<Directory />
   AllowOverride none
    Require all denied
</Directory>
  
//设置为自动启动
# systemctl enable httpd.service
ln -s'/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
//在centos7中chkconfig httpd on 被替换成 systemctl enable httpd

配置WEB站点 (假设使用/wwwroot目录下的文档

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//创建两个网站的目录结构及测试用页面文件
# mkdir/wwwroot/www
# echo"www.bigcloud.local" > /wwwroot/www/index.html
  
# mkdir/wwwroot/crm
# echo"crm.bigcloud.local" > /wwwroot/crm/index.html
 //配置虚拟机主机
# cd/etc/httpd/
# mkdirvhost-conf.d
# echo"Include vhost-conf.d/*.conf" >> conf/httpd.conf
  
# vi/etc/httpd/vhost-conf.d/vhost-name.conf
//添加如下内容
<VirtualHost *:80>
   ServerNamewww.bigcloud.local
  DocumentRoot /wwwroot/www/
</VirtualHost>
<Directory /wwwroot/www/>
    Requireall granted
</Directory>
  
<VirtualHost *:80>
   ServerNamecrm.bigcloud.local
  DocumentRoot /wwwroot/crm/
</VirtualHost>
<Directory /wwwroot/crm/>
   Require ip192.168.188.0/24   //可以设置访问限制
</Directory>

本文出自 “李豪” 博客,请务必保留此出处http://leaus.blog.51cto.com/9273485/1540717

CentOS7安装配置Apache HTTP Server的更多相关文章

  1. CentOS 7安装配置Apache HTTP Server

    原文 CentOS 7安装配置Apache HTTP Server   RPM安装httpd # yum -yinstall httpd //安装httpd会自动安装一下依赖包: apr apr-ut ...

  2. Centos7安装配置Apache+PHP+Mysql+phpmyadmin

    转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl ...

  3. Centos7 安装配置Apache+Mysql5.7+PHP7.0+phpmyadmin

    Centos7 下安装配置Apache+Mysql5.7+PHP7.0+phpmyadmin 搭建LAMP =========================================Apach ...

  4. CentOS7安装配置Apache、PHP和MySQL

    一.安装Apache sudo yum install httpd 安装成功后,Apache操作命令: systemctl start httpd //启动apache systemctl stop ...

  5. centos7 安装配置apache

    1.在安装apache yum install httpd 2.启动测试 systemctl  start httpd // restart (重启) 3.查看运行状态 service httpd s ...

  6. Linux安装配置apache

    Linux安装配置apache   1.获取软件: http://httpd.apache.org/  httpd-2.2.21.tar.gz 2.安装步骤: 解压源文件: 1 tar zvxf ht ...

  7. Centos7安装配置JDK8

    Centos7安装配置JDK8 一.准备工作 第一步,去甲骨文官网下载Jdk相应的版本,我这里下载的是jdk1.8. 第二步将你从官网上下载下来的jdk使用FTP工具上传到云服务器上的相应目录,我的是 ...

  8. 在 Linux 多节点安装配置 Apache Zookeeper 分布式集群

    规划: 三台物理服务器就形成了(法定人数).对于高可用性集群,您可以使用高于3的任何奇数.例如,如果设置5台服务器,则集群可以处理两个故障节点等. 物理服务器需要开启的端口 2888 , 3888 和 ...

  9. (转)Centos7安装配置NFS服务和挂载

    Centos7安装配置NFS服务和挂载 原文:https://www.u22e.com/601.html NFS简介 NFS(Network File System)即网络文件系统,是FreeBSD支 ...

随机推荐

  1. ED/EP简介

    ED:electronic Deposit,电子存折 EP:electronic Purse,电子钱包 PIN:personal identification number,个人识别码 MAC:Mes ...

  2. 软件工程随堂小作业——随机四则运算Ⅱ之算法思路(C++)

    1.题目避免重复: (1)利用系统时间来产生随机数,重复率会降低. (2)建立链表,逐个判断.可读取写入文件. 2.可定制(数量/打印方式): (1)格式有默认值; (2)可以选择重新设置分几列和每行 ...

  3. mysql 存储过程 -- 游标的使用(备忘)

    BEGIN ; DECLARE f_ratio FLOAT DEFAULT 0.8; ); ); DECLARE i_statDate DATE; DECLARE i_accumulateCount ...

  4. C#打印页面的纸张设置问题Spread表格控件

    这段时间学习spread控件,用到打印设置上边,其他的设置都还好说,但是打印纸张的大小,纸张类型等把我折腾的够呛,找了半天才找到,记录下来备查. 1.打印纸张类型: System.Drawing.Pr ...

  5. 【Insertion Sorted List】cpp

    题目: Sort a linked list using insertion sort. 代码: /** * Definition for singly-linked list. * struct L ...

  6. How to find and fix Bash Shell-shock vulnerability CVE-2014-6271 in unix like system

    type command - env x='() { :;}; echo vulnerable' bash -c 'echo hello' in your terminal.   if your sy ...

  7. BZOJ 3223 文艺平衡树 [codevs3303翻转区间]

    AC通道:http://www.lydsy.com/JudgeOnline/problem.php?id=3223 通道2:http://codevs.cn/problem/3303/ 题目分析: 我 ...

  8. Leetcode#172 Fractorial Trailing Zero

    原题地址 n!含有多少个因子10,则结尾有多少个0 10=2*5,而2的个数肯定比5多,所以n!含有多少个因子5,则结尾有多少个0 如何计算n!有多少个因子5呢? 比如n=13,则: n! = 13 ...

  9. vertical sync

    these days, I am compelting vertical sync https://msdn.microsoft.com/zh-cn/library/windows/desktop/b ...

  10. sample a texture as a rendertarget

    ID3D11DeviceContext::PSSetShaderResources: Resource being set to PS shader resource slot 0 is still ...