2

I know it seems a simple task and I did it many times for Apache 2.0-2.2 but in 2.4 config doesn't work. I am trying to configure basic auth for directiry:

<Directory /var/www/html/docs>
    AuthType Basic
    AuthName Documents
    AuthBasicProvider file
    AuthUserFile /etc/apache2/.iRedMail
    Require valid-user
</Directory>

Log files when I open and enter correct password:

[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

I spent more than 3 hours to understand what I'm doing wrong. Please help.

4
  • Could you test if it makes any difference if you specify a specific user name instead? So replace Require valid-user with Require user someusername, and tell us what the result is.
    – kasperd
    Aug 17, 2014 at 9:31
  • with Require user zeiba log shows: [Sun Aug 17 11:45:40.897457 2014] [:error] [pid 2658] No requires line available. If I enter wrong username I see: [Sun Aug 17 11:47:15.188447 2014] [auth_basic:error] [pid 2679] [client 37.229.191.182:55237] AH01618: user Z not found: /docs/robots.txt Aug 17, 2014 at 9:47
  • I have no AuthBasicProvider in my config. But apart from that, they look the same to me. My config is a .htaccess file, which overrides for only a single directory. In the actual vhost configuration, I have Require all granted, which might have something to say.
    – kasperd
    Aug 17, 2014 at 10:39
  • 2
    Finally!!! It works!!! I noted that error No requires line available is located in code mod_auth_mysql.c. So I disabled auth_mysql_module and issue was solved. Aug 17, 2014 at 10:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy