[英]apache with virtual hosts: 403 forbidden
I know, this problem has been faced several times, but after reading many posts, it still does not work. 我知道,这个问题已经遇到过几次了,但是在阅读了很多帖子之后,它仍然无法正常工作。 the funny part: yesterday it worked.
有趣的是:昨天它起作用了。 so, who can help me find the error?
那么,谁能帮助我找到错误? step by step:
一步步:
I am using Apache/2.2.29 on Mac OS 10.8.5 我在Mac OS 10.8.5上使用Apache / 2.2.29
/etc/hosts / etc / hosts
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 scripts
127.0.0.1 page
/private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf
[...]
ServerRoot "/usr"
User _www
Group _www
DocumentRoot "/Users/me/server"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
[...]
<Directory "/Users/me/server">
MultiViews
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
[...]
Include /private/etc/apache2/extra/httpd-vhosts.conf
[...]
/private/etc/apache2/extra/httpd-vhosts.conf /private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "/Users/me/server/scripts"
ServerName scripts
ErrorLog "/Users/me/server/scripts/errlog"
CustomLog "/Users/me/server/scripts/customlog" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/me/server/page"
ServerName scripts
ErrorLog "/Users/me/server/page/log/errlog"
CustomLog "/Users/me/server/page/log/customlog" common
</VirtualHost>
Given Rights: (Full rights for testing) 授予的权利:(测试的完整权利)
/Users/me/server
drwxrwxrwx 5 _www _www
/Users/me/server/page
drwxrwxrwx 4 _www _www
Restart apache 重新启动Apache
sudo apachectl restart
I tried to restart the browser as well 我也尝试重新启动浏览器
Log Files All log files are empty 日志文件所有日志文件均为空
Result 结果
http://localhost
http://page
neither of them works, I keep on getting the forbidden message. 它们都不起作用,我不断收到禁止的消息。
您需要在httpd-vhosts.conf的第二部分中将ServerName
从scripts
更改为page
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.