1.打开apache的配置文件
httpd.conf下面:Include conf/extra/httpd-vhosts.conf 去掉前面注释
2.添加监听端口
#Listen 12.34.56.78:80
Listen 80
Listen 8008 (如果不好使 就把IP加上 Listen IP:8008) 端口可以随便写 只要没有被占用就可以
3.配置vhost文件
<VirtualHost *:8008>(注意修改端口)
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "目录路径"
ServerName localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
4.重启服务 即可
本文详细介绍了如何在Apache服务器上配置多个虚拟主机站点,包括取消配置文件注释、添加监听端口、设置虚拟主机参数等步骤,并提供了重启服务的方法。
1万+

被折叠的 条评论
为什么被折叠?



