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. Leetcode Variant-Plus N

    Given a non-negative number represented as an array of digits, plus N to the number. The digits are ...

  2. android 图片缩放抗锯齿

    之前用的时候只设置了antialias属性,其实要设置两个flag才行 paint.setFlags(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG); ...

  3. Codeforces Round #265 (Div. 1) C. Substitutes in Number dp

    题目链接: http://codeforces.com/contest/464/problem/C J. Substitutes in Number time limit per test 1 sec ...

  4. Codeforces Round #352 (Div. 2) C. Recycling Bottles 暴力+贪心

    题目链接: http://codeforces.com/contest/672/problem/C 题意: 公园里有两个人一个垃圾桶和n个瓶子,现在这两个人需要把所有的瓶子扔进垃圾桶,给出人,垃圾桶, ...

  5. 转载:百度原CTO李一男经典语录

    原文地址:http://www.cnblogs.com/marvin/archive/2010/01/20/1652088.html 百度原CTO李一男经典语录 [1]好好规划自己的路,不要跟着感觉走 ...

  6. lle算法

    http://www.pami.sjtu.edu.cn/people/xzj/introducelle.htm

  7. NGP处理包

    NGP处理部分(主要就是这个RunOnce函数,客户单肯定是开个线程取调用这个RunOnce的) void NGP::RunOnce() { m_spTimerFac->driveTimer() ...

  8. Nodejs Express 4.X 中文API 2--- Request篇

    相关阅读: Express 4.X API 翻译[一] --  Application篇 Express4.XApi 翻译[二] --  Request篇 Express4.XApi 翻译[三] -- ...

  9. css hack一览

    浏览器对css hack的支持情况

  10. PHPStorm+PHP5.6+WIN7+IIS7

    文件下载 以下为参考网址,如无法打开或变动,请自行搜索,获取最新版本文件请行搜索 PHP Manager:http://www.iis.net/downloads/community/2010/09/ ...