0

我正在尝试将 htpassd 用于我的网站,并将几个 ip 列入白名单。这很完美,但是如果用户按下取消按钮,它会显示标准的 apache 401 错误页面。

使用 ErrorDocument 我应该自定义它,所以我在 /var/www/auth.html 中放置了一个 html 文件 auth.html。如果我去 my.server.ip.address/auth.html 我会看到该页面。

但结合 ErrorDocument 我得到标准消息:

Additionally, a 401 Authorization Required error was encountered while trying to use an ErrorDocument to handle the request.

我该如何调试,/var/log/apache/error.log 中没有显示

这是我用来设置它的一部分 apache conf,它通过 /etc/apache2/conf.d 包含在我的 debian 机器上。

<Directory /var/www/ >
    Allow from all
    Satisfy Any
</Directory>

<Directory /home/goodmorning >
Order deny,allow
Deny from all
AuthName "Wachtwoord opvragen kan via support@company.nl"
AuthUserFile /home/hg/htpasswd
AuthType Basic
Require valid-user
Allow from w.x.y.z
Allow from w.x.y.z
Allow from w.x.y.z
Satisfy Any

</Directory>
ErrorDocument 401 /auth.html
4

1 回答 1

0

确保 apache 用户可以读取 /auth.html

并且此文档不应在受保护的目录中。

于 2014-02-04T18:21:45.097 回答