Apache2 VirtualHost 403 error
2009-05-13 15:11:51来源:未知 阅读 ()
Working with virtual hosts under Apache2 is pretty easy, but I had some trouble getting things started due to some unclear docs and lack of examples. My biggest problem was the "HTTP 403 / client denied by server configuration error".
There are two causes to 403 errors with virtual hosts.
First, every single parent path to the virtual document root must be Readable, Writable, and Executable by the web server httpd user. The access_log will show a 403 code, but the following message is returned to the browser with no "403" string printed:
Forbidden
You don't have permission to access /index.html on this server.
I got nailed a couple of times because one of the parent directories in the virtual document root was not executable by 'www' (the user my web server runs as). The error log file messages offer no hints when this happens. It makes it seem like a configuration problem, so you can waste a lot of time look for the problem in httpd.conf.
The second cause is actually a configuration problem -- the problem is forgetting to allow access in the httpd.conf. In this case the access_log will show a 403 error and Aapche2 will also sometimes send a "403" in the error string to the browser:
HTTP 403 / client denied by server configuration error
It may also send the Forbidden message with no "403" string. I don't know what this difference means.
Forbidden
You don't have permission to access /index.html on this server.
A tail of the error_log gives a message like this for each access attempt:
[Tue Jul 25 17:58:17 2006] [error] [client 192.168.1.1] client denied by server configuration: /var/www/vhosts/palermo/
The problem is that the extra/httpd-vhosts.conf is missing the directive to allow access to the directory.
Allow access by adding a section inside the section.
allow from all
The following should give a better idea of how this should work:
ServerName palermo.example.com
ServerAlias palermo.example.com
DocumentRoot /var/www/vhosts/palermo
allow from all
It is strange that neither the sample httpd-vhosts.conf file that comes with Apache2 nor the Apache2 documentation on VirtualHost gives a example that could work.
Retrieved from "
http://www.noah.org/wiki/Apache2_VirtualHost_403_error
"
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10599/showart_1335852.html
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- Freebsd oracle 10g 2009-05-13
- KDE/FreeBSD 测试 QT-4.5.1. 2009-05-13
- 提示:bad kernel: arp : 内网IP地址 is on em0 but got rep 2009-05-13
- OpenBSD 4.5下安装Gnome 2.24成功! 2009-05-13
- OpenBSD 4.5 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash