127.0.0.1 有效,本地主机无效 - VH - Zend Ce,Mac
我遇到了奇怪的问题,添加我的虚拟主机conf条目后,localhost无法工作(禁止403),但127.0.0.1可以(全部通过浏览器访问 - http),这里有我的conf:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/MyData/__www/default"
ServerName localhost
<Location />
Order deny,allow
Deny from All
Allow from 127.0.0.1
Options +FollowSymLinks -Indexes
</Location>
</VirtualHost>
有趣的是,当我更改时允许 from to:
Allow from localhost
localhost 可以工作,但 127.0.0.1 不行,localhost 在主机文件中正确映射。
请帮忙,
欢呼, /马尔辛
I am having weired problem, after adding my virtual host conf entry localhost is not working (getting forbiden 403) but 127.0.0.1 does (all accessed via browser - http), here you have my conf:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/MyData/__www/default"
ServerName localhost
<Location />
Order deny,allow
Deny from All
Allow from 127.0.0.1
Options +FollowSymLinks -Indexes
</Location>
</VirtualHost>
The funny thing is that when I change allow from to:
Allow from localhost
localhost works but 127.0.0.1 not, localhost is mapped properly in hosts file.
please help,
cheers,
/Marcin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这有效:
This works:
在某些系统上,
localhost
映射到 IPv6 地址::1
。尝试:On some systems,
localhost
maps to an IPv6 address,::1
. Try: