我在 Windows 7 上设置虚拟主机时遇到问题。我正在运行 wamp。
我的主机文件包括:
127.0.0.1 local.tribune.com
我已经在我的 httpd.conf 中包含了 httpd-vhosts.conf。
我的 httpd-vhosts.conf 包括:
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/Users/Name/My Documents/the tribune/website/local.tribune.com/"
ServerName local.tribune.com
</VirtualHost>
这是奇怪的事情..如果我从 DocumentRoot 中删除“我的”,然后在浏览器中转到 localhost 就可以了,我可以看到 phpmyadmin,但我看不到目录的内容,因为路径不正确。但是一旦我将“我的”放在路径中,wamp 图标就永远不会变白(它保持黄色),并且我无法访问 localhost 或 local.tribune.com。
一旦我再次删除“我的”,本地主机将再次工作。
我在 wampserver.com 和其他地方看到过很多关于这个问题的帖子,但没有一个回答或解决。大多数已解决的是基本问题,例如不包括或删除 httpd-vhosts.conf、缺少字符等。