详解Redhat7之如何完成 实现一个 web 服务器

完成 实现一个 web 服务器
描述:在 system1 上配置一个站点 http://system1.domain1.example.com 然后执行下述步骤:

先安装并启动,开机自启

yum install httpd
*****************************************************************
vim /etc/httpd/conf.d/a.conf
(在这里写是因为/etc/httpd/conf/httpd.conf结尾包含了/etc/httpd/conf.d/里面.conf结尾的文件)
然后写一些虚拟主机的参数
<VirtualHost * :80>
DocumentRoot /var/www/html
ServerName server0.example.com
</VirtualHost>
然后保存退出
*****************************************************************
systemctl restart httpd
systemctl enable httpd
*****************************************************************

从 http://rhgls.domain1.example.com/materials/station.html 下载文件,并且将文件重命名为 index.html 不要修改此文件的内容,将文件 index.html 拷贝到您的 web 服务器的 DocumentRoot 目录下

cd /var/www/html
wget -O index.html http://rhgls.domain1.example.com/materials/server.html

 (

为什么-O?

详解Redhat7之如何完成 实现一个 web 服务器

来自https://www.cnblogs.com/semonxv/p/3816366.html

)

然后防火墙永久开http,https,然后reload

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall --reload

允许来自于 domain1.example.com 域的客户端访问此Web服务
拒绝来自于 my133t.org 域的客户端访问此Web服务

加富规则