1、安装apache服务器、并配置访问端口为:9999
yum install httpd -y
yum install httpd-manual
systemctl start httpd
systemctl enable httpd
firewall-cmd --list-all
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
/var/www/html
/var/www/html/index.html
vim /var/www/html/index.html
vim /etc/httpd/conf/httpd.conf/
然后将80改为9999

:wq(退出保存即可)
2、添加新的默认页面sorry.html,在默认主页不能访问的情况下显示“很抱歉。。。该网站正在维护中,请您在4月1号后访问,感谢您的支持。”
cd /var/www/html/
touch sorry.html
vim sorry.html

:wq!
systemctl restart httpd
3、配置三台虚拟主机,用基于端口的方式配置。
输入:nmtui


分别用ping命令ping我们配置的三个IP地址,ping通即成功
下一步我们在配置文件中描述基于IP地址的虚拟主机 vim /etc/httpd/conf/httpd.conf 直接将我们的信息找地方写入即可
<VirtualHost 192.168.127.150>
DocumentRoot /home/wwwroot/150
ServerName www.linuxprobe.com
<Directory /home/wwwroot/150>
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 192.168.127.160>
DocumentRoot /home/wwwroot/160
ServerName bbs.linuxprobe.com
<Directory /home/wwwroot/160 >
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
配置完毕后我们要重启一下httpd服务。
systemctl restart httpd










