大网数据广告活动
服务器运维问答

Apache: Client denied by server configuration

· 52CE 我爱测

I have switched from apache 2.2.22 to apache 2.4.10, and all of the sudden an alias I use to access some logs no longer works. This is my configuration file: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName mdvns-seq…

问题原文

原帖链接 · Dave · CC BY-SA 3.0

I have switched from apache 2.2.22 to apache 2.4.10, and all of the sudden an alias I use to access some logs no longer works.

This is my configuration file:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        ServerName mdvns-sequencer

        DocumentRoot /var/www/

        <Directory /var/log/mdvns/>
                Order allow,deny
                Allow from all
                Options +Indexes
        </Directory>

        Alias /logs/ /var/log/mdvns/

        <Directory /var/www>
                AddHandler cgi-script .py
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

When I try and access /logs/ (the alias I've set up), I get a 403 forbidden. The error.log has the following message:

[Sat Jan 01 00:38:25.348732 2000] [authz_core:error] [pid 1256:tid 3053450288] [client 192.168.2.135:64882] AH01630: client denied by server configuration: /var/log/mdvns/

I've gone over everything in the wiki, but just can't find a solution. The directory and files in it have read access for owner/group/other. The directory is definitely there and typed corrected.

I should note I get the same error if I try and access a file in the /logs/ directory.

Any ideas?

已采纳解答

原帖链接 · user5747873 · CC BY-SA 3.0

Permission options changed in 2.4. More information on 2.4 upgrade documentation

Instead of

<Directory /var/log/mdvns/>
    Order allow,deny
    Allow from all
    Options +Indexes
</Directory>

Try

<Directory /var/log/mdvns/>
    Options +Indexes
    AllowOverride All
    Require all granted
</Directory>

Same for the /var/www directory

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。