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. java基础学习之对象转型

    对象转型(casting): 1)一个基类的引用类型变量可以指向其子类的对象 2)一个基类的引用不可以访问其子类对象新增加的成员(属性和方法) 3)可以使用引用变量instanceof类名,来判断该引 ...

  2. bower解决js的依赖管理

    bower解决js的依赖管理 前言: 一个新的web项目开始,我们总是很自然地去下载需要用到的js类库文件,比如jQuery,去官网下载名为jquery-1.10.2.min.js文件,放到我们的项目 ...

  3. LNMP系列网站零基础开发记录(一)

    [目录] 扯淡吹逼之开发前奏 Django 开发环境搭建及配置 web 页面开发 Django app开发 Django 站点管理 Python 简易爬虫开发 Nginx&uWSGI 服务器配 ...

  4. Careercup - Google面试题 - 5765091433644032

    2014-05-08 09:32 题目链接 原题: Given a binary tree, how would you copy it from one machine to the other, ...

  5. 01.Apache FtpServer配置

    1.解压Apache FTPServer 将下载下来的压缩包(ftpserver-1.0.6.zip)解压到本地,其目录结构如下图: 2.修改users.properties 修改 \apache-f ...

  6. CSS3动画制作的简单示例

    CSS3 大大强化了制作动画的能力,但是如果要做出图案比较复杂的动画,选择 GIF 依然是一个不错的选择.今天给大家介绍一个使用 CSS animation 配合雪碧图(CSS sprite)来制作动 ...

  7. Word2007插入两种页码

    做毕设,摘要,Abstract,目录,第一章,现在想要“摘要,Abstract,目录”编页码“为罗马数字,第一章开始为阿拉伯数字,可以按如下步骤: 1.各部分插入分页符,这与插入两种页码无关,不过是为 ...

  8. 【bzoj1007】[HNOI2008]水平可见直线

    1007: [HNOI2008]水平可见直线 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 5932  Solved: 2254[Submit][Sta ...

  9. spring.net +dapper 打造简易的DataAccess 工具类.

    public class DBUtil { /// <summary> /// 数据库连接字符串 /// </summary> private static string Da ...

  10. ios frame、bound和center定义及使用场景总结

    frame:指的是视图在父视图的坐标系统中的大小和位置. bound:指的是视图在视图本身的坐标系统中的大小(位置起点是原点). center:指的是视图在父视图坐标系统中的中心点. frame和bo ...