9、RHCE 配置 Apache服务

完成 实现一个 web 服务器
描述:在 system1 上配置一个站点 http://system1.domain8.example.com 然后执行下述步骤:
从 http://rhgls.domain8.example.com/materials/station.html 下 载 文 件 , 并 且 将 文 件 重 命 名 为
index.html 不要修改此文件的内容
将文件 index.html 拷贝到您的 web 服务器的 DocumentRoot 目录下
来自于 domain8.example.com 域的客户端可以访问此Web服务
来自于 my133t.org 域的客户端拒绝访问此Web服务

System1:

1 、安装软件包
[root@system1 ~]# 
yum install -y httpd 

2 、建立配置文件
[root@system1 ~]#
vim /etc/httpd/conf.d/httpd‐vhosts.conf
 
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName system1.group8.example.com
<Directory "/var/www/html">
<RequireAll>
Require all granted
Require not host .my133t.org
</RequireAll>
</Directory>
</VirtualHost>

[root@system1 ~]# 
wget ‐O /var/www/html/index.html http://server.group8.example.com/pub/system1.html

3 、设定服务开机启动并且马上启动服务
[root@system1 ~]# 
systemctl enable httpd
[root@system1 ~]# 
systemctl start httpd

4 、设定防火墙
[root@system1 ~]#
firewall‐cmd ‐‐permanent ‐‐add‐service=http
[root@system1 ~]# 
firewall‐cmd ‐‐reload

验证:在 system2 上执行
[root@system2 ~]# 
curl system1.group8.example.com

Site:system1.group8.example.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值