繁体   English   中英

带有虚拟主机的apache:禁止403

[英]apache with virtual hosts: 403 forbidden

我知道,这个问题已经遇到过几次了,但是在阅读了很多帖子之后,它仍然无法正常工作。 有趣的是:昨天它起作用了。 那么,谁能帮助我找到错误? 一步步:

我在Mac OS 10.8.5上使用Apache / 2.2.29

/ 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

[...]
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

<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>

授予的权利:(测试的完整权利)

/Users/me/server
    drwxrwxrwx  5 _www     _www  

/Users/me/server/page 
    drwxrwxrwx  4 _www  _www

重新启动Apache

sudo apachectl restart

我也尝试重新启动浏览器

日志文件所有日志文件均为空

结果

http://localhost
http://page

它们都不起作用,我不断收到禁止的消息。

您需要在httpd-vhosts.conf的第二部分中将ServerNamescripts更改为page

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM