WAMP:设置 VirtualHosts 不起作用
WAMP: Setting VirtualHosts not working
我已经按照许多网站上有关如何为 WAMP (Apache 2.4.9) 设置 VirtualHosts 的说明进行操作,甚至按照 forum.wampserver.com 中的步骤进行操作,但没有任何积极的结果。
这是我的文件修改列表:
Windows\System32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 local.ruta.com.ar
::1 localhost
::1 local.ruta.com.ar
apache2.4.9\conf\httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin email@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
<Directory "c:/wamp/www">
AllowOverride All
Options +Indexes
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin email@ruta
DocumentRoot "c:/wamp/www/ruta"
ServerName local.ruta.com.ar
ServerAlias www.local.ruta.com.ar
ErrorLog "logs/ruta.log"
CustomLog "logs/ruta-access.log" common
<Directory "c:/wamp/www/ruta">
AllowOverride All
Options +Indexes
Require local
</Directory>
</VirtualHost>
我不知道还能做什么。对我来说一切似乎都很好,我检查了很多次,但我无法让它工作。我尝试更改 Directory
和 DocumentRoot
中的斜杠、引号,删除除 DocumentRoot
、ServerName
和 Directory
...
之外的所有内容
请给我指出正确的方向:(提前致谢!
经过一个小时的排查,RiggsFolly 终于解决了这个奇怪的问题。
长话短说,PC 是在尝试 Teredo 连接,这是一种过渡 IPv6 技术,但失败了,因为它位于 IPv4 NAT 设备之后。
Solution he found in SuperUser(感谢迈克尔·汉普顿,无论您身在何处):
Why does Win7 SP7 64-bit try to resolve DNS agsint IPv6 DNS Servers? -
Michael Hampton
Thus, since Teredo is enabled, your computer thinks it
has IPv6 connectivity, when that connectivity is actually broken. (The
network status icon uses a completely different check for connectivity
that is more accurate.)
To resolve the issue, disable Teredo (and while you're at it, the
other two problematic ones, 6to4 and ISATAP). Right-click on Command
Prompt and click Run as Administrator, then run the following:
netsh int ipv6 isatap set state disabled
netsh int ipv6 6to4 set state disabled
netsh int teredo set state disabled
Then restart your computer.
我已经按照许多网站上有关如何为 WAMP (Apache 2.4.9) 设置 VirtualHosts 的说明进行操作,甚至按照 forum.wampserver.com 中的步骤进行操作,但没有任何积极的结果。
这是我的文件修改列表:
Windows\System32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 local.ruta.com.ar
::1 localhost
::1 local.ruta.com.ar
apache2.4.9\conf\httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin email@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
<Directory "c:/wamp/www">
AllowOverride All
Options +Indexes
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin email@ruta
DocumentRoot "c:/wamp/www/ruta"
ServerName local.ruta.com.ar
ServerAlias www.local.ruta.com.ar
ErrorLog "logs/ruta.log"
CustomLog "logs/ruta-access.log" common
<Directory "c:/wamp/www/ruta">
AllowOverride All
Options +Indexes
Require local
</Directory>
</VirtualHost>
我不知道还能做什么。对我来说一切似乎都很好,我检查了很多次,但我无法让它工作。我尝试更改 Directory
和 DocumentRoot
中的斜杠、引号,删除除 DocumentRoot
、ServerName
和 Directory
...
请给我指出正确的方向:(提前致谢!
经过一个小时的排查,RiggsFolly 终于解决了这个奇怪的问题。 长话短说,PC 是在尝试 Teredo 连接,这是一种过渡 IPv6 技术,但失败了,因为它位于 IPv4 NAT 设备之后。
Solution he found in SuperUser(感谢迈克尔·汉普顿,无论您身在何处):
Why does Win7 SP7 64-bit try to resolve DNS agsint IPv6 DNS Servers? - Michael Hampton Thus, since Teredo is enabled, your computer thinks it has IPv6 connectivity, when that connectivity is actually broken. (The network status icon uses a completely different check for connectivity that is more accurate.)
To resolve the issue, disable Teredo (and while you're at it, the other two problematic ones, 6to4 and ISATAP). Right-click on Command Prompt and click Run as Administrator, then run the following:
netsh int ipv6 isatap set state disabled
netsh int ipv6 6to4 set state disabled
netsh int teredo set state disabled
Then restart your computer.