我知道这看起来是个简单的任务,我为 Apache 2.0-2.2 做过很多次,但在 2.4 中配置不起作用。我正在尝试为目录配置基本身份验证:
<Directory /var/www/html/docs>
AuthType Basic
AuthName Documents
AuthBasicProvider file
AuthUserFile /etc/apache2/.iRedMail
Require valid-user
</Directory>
当我打开并输入正确密码时记录文件:
[Sun Aug 17 10:51:17.817681 2014] [authz_core:debug] [pid 14318] mod_authz_core.c(802): [client 37.229.191.182:52066] AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
[Sun Aug 17 10:51:17.818377 2014] [authz_core:debug] [pid 14318] mod_authz_core.c(802): [client 37.229.191.182:52066] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[Sun Aug 17 10:51:25.902938 2014] [authz_core:debug] [pid 14357] mod_authz_core.c(802): [client 37.229.191.182:52072] AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
[Sun Aug 17 10:51:25.903656 2014] [authz_core:debug] [pid 14357] mod_authz_core.c(802): [client 37.229.191.182:52072] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[Sun Aug 17 10:51:25.904830 2014] [:error] [pid 14357] No requires line available
我花了 3 个多小时才明白我做错了什么。请帮忙。