虚拟主机的apache:403禁止

时间:2015-06-10 20:35:20

标签: macos apache unix

我知道,这个问题已经多次面对,但在阅读了很多帖子之后,它仍然无效。有趣的部分:昨天它奏效了。那么,谁能帮我找到错误?一步一步:

我在Mac OS 10.8.5上使用Apache / 2.2.29

的/ etc /主机

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

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

1 个答案:

答案 0 :(得分:1)

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