Apache2“您无权访问此服务器上的/

时间:2014-05-23 07:20:25

标签: apache apache2

无法访问文档根文件夹文件 - 出现此错误:

You don't have permission to access / on this server.

Apache版

Server version: Apache/2.2.22 (Ubuntu)

虚拟主机配置 内部网站 - 可用

<VirtualHost *:80>
        ServerName site1

        ServerAlias www.site1


        RailsEnv production
        RackEnv production


        DocumentRoot /var/www/site1/webservices/public

        <Directory "/var/www/site/webservices/public">
                Options FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
                Header set Access-Control-Allow-Origin "*"
        </Directory>


</VirtualHost>

在apache2 / hosts文件中添加了

127.0.0.1 site1

重启Apache2

/etc/init.d/apache2 restart

可以是许可问题吗?

1 个答案:

答案 0 :(得分:1)

我认为你需要告诉Apache如何处理文件夹(因为/是一个文件夹)。您需要告诉Apache应该使用哪个文件来列出文件夹内容。

尝试设置:

DirectoryIndex index.html

现在对于ruby,我不确定,但是你可能忘记了index.html文件?

在选项设置中,您可以添加索引,并删除多视图,因为多视图会尝试猜测要使用的文件,这通常会使事情变得更难。所以使用类似的东西:

Options FollowSymLinks Indexes -Multiviews
相关问题