原文 CentOS 7安装配置Apache HTTP Server

 

RPM安装httpd

# 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.

修改配置文件

# 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目录下的文档)

//创建两个网站的目录结构及测试用页面文件

# mkdir/wwwroot/www

# echo"www.linuxidc.local" > /wwwroot/www/index.html

# mkdir/wwwroot/crm

# echo"crm.linuxidc.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.linuxidc.local

DocumentRoot /wwwroot/www/

</VirtualHost>

<Directory /wwwroot/www/>

Requireall granted

</Directory>

<VirtualHost *:80>

ServerNamecrm.linuxidc.local

DocumentRoot /wwwroot/crm/

</VirtualHost>

<Directory /wwwroot/crm/>

Require ip192.168.188.0/24  //可以设置访问限制

</Directory>

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

  1. CentOS7安装配置Apache HTTP Server

    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 http ...

  2. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

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

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

  4. 记录:CentOS 7 安装配置分布式文件系统 FastDFS 5.1.1

    CentOS 7 安装配置分布式文件系统 FastDFS 5.1.1 软件下载:http://download.csdn.net/download/qingchunwuxian1993/9897458 ...

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

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

  6. 分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)——第一篇

    分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)--第一篇 简介 首先简单了解一下基础概念,FastDFS是一个开源的轻量级分布式文件系统,由 ...

  7. CentOS 7.2配置Apache服务httpd小伙伴们可以参考一下

    这篇文章主要为大家详细介绍了CentOS 7.2配置Apache服务 httpd上篇,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 一.Perl + mod_perl 安装mod_perl使Per ...

  8. CentOS 7安装配置Samba服务器

    CentOS 7安装配置Samba服务器 CentOS 7下Samba服务器安装配置过程笔记. 假设我们有这样一个场景 共享名 路径 权限 SHAREDOC /smb/docs 所有人员包括来宾均可以 ...

  9. CentOS 7安装配置Samba服务器(挂载共享文件夹)

    CentOS 7安装配置Samba服务器 CentOS 7下Samba服务器安装配置过程笔记. 假设我们有这样一个场景 共享名 路径 权限 SHAREDOC /smb/docs 所有人员包括来宾均可以 ...

随机推荐

  1. 【Android进阶】Android面试题目整理与讲解(二)

    1. ArrayList,Vector, LinkedList 的存储性能和特性 ArrayList 和 Vector 都是使用数组方式存储数据,此数组元素数大于实际存储的数据以便增加和插入元素,它们 ...

  2. 怎么样Eclipse IDE for C/C++ Developers正确编译GTK规划?(解决)

    <span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 25.99 ...

  3. ios-上拉电阻负载许多其他接口

    想尝试拉加载意识到有多少开始了他的研究之旅,我看了两天做出最终的界面. 之所以这么慢是由于,我不知道要将上拉出现的view放在哪.就能在scrollView拉究竟部的时候被拉出来.还有就是怎么拉出来之 ...

  4. ProgressBar样式总结与自己主动填充方法(代码)

    有时候开发的时候须要用一个进度条告知用户眼下正在执行一个耗时操作,可是并不须要明白知道某个value来setProgress,所以就能够自己定义一个时间和进度让进度条自己主动执行了. 以下是代码: H ...

  5. ZOJ Monthly, October 2010 ABEFI

    ZOJ 3406 Another Very Easy Task #include <cstdio> #include <cstring> const int N = 10000 ...

  6. 新手学Unity3d的一些网站及相应学习路线

    一.unity3d有什么优势 如果您对开发游戏感兴趣,而又没有决定选择哪一个游戏引擎,别犹豫了 unity3d是一个很好的选择! 就我来看unity3d优势主要有以下几方面:首先部署简单,自带了一个I ...

  7. C#和C++下数据类型对应表

    /C++中的DLL函数原型为//extern "C" __declspec(dllexport) bool 方法名一(const char* 变量名1, unsigned char ...

  8. MapReduce源代码分析MapTask分析

    前言 MapReduce该分析是基于源代码Hadoop1.2.1代码分析进行的基础上. 该章节会分析在MapTask端的详细处理流程以及MapOutputCollector是怎样处理map之后的col ...

  9. 获取Winform窗体、工作区 宽度、高度、命名空间、菜单栏高度等收集

    MessageBox.Show("当前窗体标题栏高"+(this.Height - this.ClientRectangle.Height).ToString());//当前窗体标 ...

  10. hdu 2243 考研绝望——复杂的文字(AC自己主动机+矩阵高速功率)

    pid=2243" target="_blank" style="">题目链接:hdu 2243 考研路茫茫--单词情结 题目大意:略. 解题思 ...