【问题标题】:"client denied by server configuration" after password protection setup in apache2在apache2中设置密码保护后“客户端被服务器配置拒绝”
【发布时间】:2014-01-20 14:16:33
【问题描述】:

我为 apache 中的密码保护创建了 .htaccess 和 .htpassword。然后,我修改了https.conf。

<Directory "/Library/WebServer/Documents">
    Options Indexes FollowSymLinks MultiViews
    #AllowOverride None
    AllowOverride AuthConfig All
    Order allow,deny
    Allow from all
</Directory>

设置后,密码保护工作正常,但问题是网页无法加载“/Library/WebServer/Documents”子目录下的图片文件。执行 tail /var/log/apache2/error_log 会给我这个错误信息。

[error] [client 127.0.0.1] client denied by server configuration: /Library/WebServer/Documents/moniwiki/data/cache/gnuplot/wikipagesetupMacBookProTask]-wikipages.png, referer: http://localhost/moniwiki/wiki.php/setupMacBookProTask

当我制作AllowOverride AuthConfig None时,错误消失了,那么就没有密码保护了。

这有什么问题?如何访问带有密码保护的子目录?

【问题讨论】:

  • 子目录将具有与其父目录相同的限制,除非在 httpd.conf(或在 .htaccess 文件中)有一个覆盖节。如果 /Library/WebServer/Documents 已经有正确的密码保护,请尝试删除任何特定于图像目录的 .htaccess 或 httpd.conf 节,并让它从父目录继承。
  • @Lotharyx:除了 /Library/WebServer/Documents 之外,https.conf 中没有额外的 .htaccess 或任何其他设置。

标签: apache .htaccess password-protection


【解决方案1】:

按照this wiki上的说明,我添加了

<Directory "/Library/WebServer/Documents/moniwiki/data/cache/gnuplot">
Order allow,deny
Allow from all
</Directory>

到 https.conf,它工作正常。

【讨论】:

    猜你喜欢
    • 2012-05-22
    • 2013-08-25
    • 2017-11-09
    • 2012-01-14
    • 1970-01-01
    • 2019-12-10
    • 2012-05-08
    相关资源
    最近更新 更多