Apache 动态虚拟主机 - 403 禁止
我正在尝试在我的 MacBook(运行 Lion OS)上配置 Apache 服务器来处理动态虚拟主机。我已经设法让它“工作”,但每当我访问该域时,我都会收到一条 403 Forbidden 消息。只要请求这些域之一,主机文件就会配置为指向 127.0.0.1。 httpd.conf 如下所示:
VirtualDocumentRoot "/web"
<Directory "/web">
Options All
AllowOverride All
Order allow,deny
Allow from all
ScriptAlias /web/cgi-bin/
</Directory>
UseCanonicalName Off
VirtualDocumentRoot /web/%2/%1/public_html
这是这样设置的,以便 http://foo.bar/ 转到“/网页/酒吧/foo/public_html/”。
我检查了所有目录和文件的权限,它们都设置为“777”。我在 Google 上搜索了好几个小时,但仍然收到 403 Forbidden。如果有人可以帮助我,我将不胜感激。
-萨姆
I am trying to configure the Apache server on my MacBooks (running Lion OS) to handle dynamic virtual hosts. I have managed to get it "working" but I whenever I access the domain I get a 403 Forbidden message. The hosts file is configured to point to 127.0.0.1 whenever one of these domains are requested. The httpd.conf is shown below:
VirtualDocumentRoot "/web"
<Directory "/web">
Options All
AllowOverride All
Order allow,deny
Allow from all
ScriptAlias /web/cgi-bin/
</Directory>
UseCanonicalName Off
VirtualDocumentRoot /web/%2/%1/public_html
This is set up so that http://foo.bar/ goes to "/web/bar/foo/public_html/".
I have checked the permissions on all the directories and files and they are all set to '777'. I have Googled for hours and hours and I am still getting 403 Forbidden. If there is anyone that can help me that would be greatly appreciated.
-Sam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没看错,这是关于许可的。检查站点的父文件夹权限,它可能会以某种方式卡在其父文件夹之一上,请确保 apache 可以读取站点根目录中的所有父文件夹。
You got it right, it's about permission. Check your site's parent folder permission, it might be stuck somehow on one of it's parent folder, make sure all of you site's parent folder from the root are readable by apache.