AH01630:客户端被名为dhtxxxx.xxx的文件的服务器配置拒绝


AH01630: client denied by server configuration for files named dhtxxxx.xxx

我不明白apache为什么会抛出这个错误,文档根目录中的所有文件都可以访问,但当我尝试访问名为dhtxxxx.xxx的文件时,如果我将文件名更改为"htmlxgrid_dhx_terrace.css"它运行良好。

文档根目录有require all granted,所以这不是问题:

<Directory /path/to/document/root >
    AllowOverride All
    Require all granted
</Directory>

以下是我在日志中看到的内容:

[authz_core:error][pid XXXX:tid XXXXXXX][client xx.xx.xx.xx:XXXX]AH01630:客户端被服务器配置拒绝:/path/to/document/root/dhtmlxGrid/skins/dhtmlxGrid_dhx_terrace.css

apachectl-v服务器版本:Apache/2.4.7(Ubuntu)服务器建成时间:2015年10月14日14:20:21

我通过添加解决了这个问题

Require all granted

到我的/etc/apache2/站点可用/d8.conf

这是Drupal 8 的工作文件

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName local.d8
    ServerAlias *.local.d8  local.d8.*
    DocumentRoot /home/a/Public/d8
    <Directory /home/a/Public/d8>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
            Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/d8_error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel notice
    CustomLog ${APACHE_LOG_DIR}/d8_access.log combined
</VirtualHost>

我终于发现了问题,这是在/etc/apache2/apache2.conf:中

<Files ~ "^.ht"> Require all denied </Files>

应该是:

<Files ~ "^'.ht"> Require all denied </Files>

事实证明,这是这里介绍的apache2厨师食谱中的一个错误:https://github.com/svanzoest-cookbooks/apache2/commit/6cb7d794cdf6fe05e650d17e432e5f5a6a86c8ea

解决方案是将apache2食谱降级为3.0.1。