【问题标题】:apache 2.4 on fresh fedora: AH01630: client denied by server configuration新的 Fedora 上的 apache 2.4:AH01630:客户端被服务器配置拒绝
【发布时间】:2016-08-15 06:16:10
【问题描述】:

我见过很多这样的问题,其中大多数最终都将语法更改为最新的 Apache 版本或弄乱了 .htaccess。但不是我的情况,因为我使用全新的 F23 安装并且从未使用过更早的 Apache 版本。我正在尝试设置一个绑定到我的一个 IP 的简单虚拟主机。这是我放入 /etc/httpd/conf.d/internal.conf 的内容

Listen 10.10.1.177:80
<VirtualHost 10.10.1.177:80>
        DocumentRoot "/home/www"
        DirectoryIndex index.html
        ServerName internal:80
        <Directory “/home/www“>
                Options All Indexes FollowSymLinks
                Options +Indexes
                Require all granted
        </Directory>
        LogLevel debug
        ErrorLogFormat "%{cu}t %M"
        ErrorLog /var/log/httpd/internal-error.log
        CustomLog /var/log/httpd/internal-access.log combined
</VirtualHost>

当我尝试时:

curl http://10.10.1.17

从该网络中的其他主机,第一个 403 页面出现并被重定向到默认的 fedora-apache 页面。此条目条目进入错误日志:

2016-04-21 22:45:50.610696 AH01626: authorization result of Require all denied: denied
2016-04-21 22:45:50.610724 AH01626: authorization result of <RequireAny>: denied
2016-04-21 22:45:50.610729 AH01630: client denied by server configuration: /home/www/
2016-04-21 22:45:50.610763 AH01626: authorization result of Require all granted: granted
2016-04-21 22:45:50.610771 AH01626: authorization result of <RequireAny>: granted

我只想让这个虚拟服务器为我放入 /home/www 的任何内容提供服务。我错过了什么?

我更改了主 httpd.conf 文件以绑定到我的其他网络接口。 我已经为“deny|denied”语句“greped”了所有 .conf 文件,并且在主配置中发现“/”目录和 .ht 文件只有默认的“Require all denied”。

【问题讨论】:

    标签: apache


    【解决方案1】:

    /etc/httpd/conf.d/welcome.conf 中有一个 LocationMatch 指令导致此行为:

    <LocationMatch "^/+$">
        Options -Indexes
        ErrorDocument 403 /.noindex.html
    </LocationMatch>
    

    注释掉那个文件的 cmets(或者清空那个文件),但是 不要删除该文件,因为httpd 的后续升级 包然后将其带回。它不会被覆盖,如果你 已在本地修改。

    【讨论】:

    • 嗨,有点帮助。谢谢。但现在我立即看到 403 页。并且日志仅包含我在原始帖子中提到的前三个条目。所以仍然是AH01630消息。当我将“index.html”附加到我的网址时,我会得到相同的行为。
    最近更新 更多