我尝试在我的WAMP安装上启用虚拟主机,但如果我启用http-vhosts.conf,则WAMP服务器无法运行,图标仍然是橙色。
这是我的 hosts 文件:
127.0.0.1 localhost
127.0.0.1 test.localhost
我的httpd.conf文件:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
我的httpd-vhosts.conf文件内容如下:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/test"
ServerName test.localhost
</VirtualHost>
如果我将VirtualHosts添加到我的httpd.conf中,它可以正常工作,但我注意到,如果我注释掉“Include conf/extra/httpd-vhosts.conf”,Apache服务器将无法运行。是什么导致了这个问题?
谢谢。