(1)在/etc/httpd/conf/httpd.conf配置文件中加入
Listen 172.16.60.6:80
Listen 172.16.60.6:8080
IncludeOptional conf.d/httpd-vhosts.conf
(2)修改/etc/httpd/conf.d/httpd-vhosts.conf
(3)配置文件中的相应的文件目录都应存在
mkdir /var/www/html/test3
在test3文件夹中建立index.html文件,写入
http://www.test3.com
(4)相关配置文件和目录准备好之后,要启动设置的相应端口(永久启用)
firewall-cmd –zone=public –add-port=80/tcp –permanent
firewall-cmd –zone=public –add-port=8080/tcp –permanent
(5)重新启动防火墙
systemctl restart firewalld.service
(6)重新启动http服务
systemctl restart httpd.service
(7)查看页面结果