1

我一直有这个access denied错误。我在CentOs 6.4上使用apache 2.2.15 。 服务器正在使用 user和 group运行。在家里,我有一个用户staging。我将他添加到apache 组apacheapache

对 docs 文件夹的权限是:

drwxrwx--- 2 staging staging 4096 Oct  4 14:33 docs

我正在使用 index.html 文件进行测试:

-rw-r--r-- 1 staging staging   13 Oct  4 14:28 index.html

SELinux被禁用。我使用的地址是staging.mysite.com

我的httpd.conf样子是这样的:

<Directory "/home/*/docs">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# 
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
# 
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options FollowSymLinks

# 
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

# 
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

我还有一个虚拟主机设置为我的暂存地址:

<VirtualHost SERVERIP:80>
        ServerName staging.mysite.com
        DocumentRoot /home/staging/docs
        ServerAdmin staging@mysite.com
        CustomLog /home/staging/logs/access_log combined
</VirtualHost>

如果您需要更多信息,请告诉我,但知道为什么它会给我这个错误吗?

4

2 回答 2

1

好吧,正如您所说,docs 文件夹只能由登台用户和登台组读取。所以apache用户可能看不懂。

一种解决方案是将 apache 用户添加到暂存组。

于 2013-10-04T15:16:49.603 回答
-1

我可以修复相同的错误:

要在您的 nagios 配置中修改 options 参数+Indexes并添加DirectoryIndex index.php

也许显示为:

<Directory "/home/*/docs">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# 
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
# 
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options FollowSymLinks +Indexes

    DirectoryIndex index.php

# 
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

# 
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

最后,重新启动您的 apache 服务。

检查权限/home/可以是+x和+r,比如chmod +rx /home/.

于 2014-04-07T12:56:56.073 回答