ENVIRONMENT

Ubuntu 10.04.4 LTS
apr 1.4.6, apr-util 1.4.1, httpd 2.4.2 compiled from source


HOW TO REPRODUCE

$ cd /usr/local/opt/httpd-2.4.2  # corresponding to ./configure --prefix
 sudo cp -pr htdocs htdocs.81
 sudo ./bin/htpasswd -b -c conf/passwords1 test1 test1
 sudo ./bin/htpasswd -b -c conf/passwords2 test2 test2

$ sudo vim conf/httpd.conf; diff conf/{original/,httpd.conf}
52a53
> Listen 81
187c188
< #ServerName www.example.com:80
---
> ServerName 127.0.1.1
461c462
< #Include conf/extra/httpd-vhosts.conf
---
> Include conf/extra/httpd-vhosts.conf

$ sudo vim conf/extra/httpd-vhosts.conf
<AuthnProviderAlias file file1>
   AuthUserFile conf/passwords1
</AuthnProviderAlias>

<AuthnProviderAlias file file2>
   AuthUserFile conf/passwords2
</AuthnProviderAlias>

<VirtualHost *:81>
   DocumentRoot "/usr/local/opt/httpd/htdocs.81"

   <Directory "/usr/local/opt/httpd/htdocs.81">
       AuthBasicProvider file1 file2

       AuthType Basic
       AuthName "Protected Area"
       Require valid-user
   </Directory>
</VirtualHost>

$ sudo ./bin/apachectl restart

$ for user in test{1..3}; do
      echo -n "$user: "
      curl --head --silent --user $user:$user \
          http://localhost:81/ | grep 'HTTP'
  done
test1: HTTP/1.1 401 Authorization Required
test2: HTTP/1.1 401 Authorization Required
test3: HTTP/1.1 401 Authorization Required


EXPECTED RESULT

test1: HTTP/1.1 200 OK
test2: HTTP/1.1 200 OK
test3: HTTP/1.1 401 Authorization Required


NOTES

If I use AuthUserFile directly instead of
AuthnProviderAlias/AuthBasicProvider, it works as expected (with one
password file only):

$ sudo vim conf/extra/httpd-vhosts.conf
<VirtualHost *:81>
   DocumentRoot "/usr/local/opt/httpd/htdocs.81"

   <Directory "/usr/local/opt/httpd/htdocs.81">
       AuthUserFile conf/passwords1

       AuthType Basic
       AuthName "Protected Area"
       Require valid-user
   </Directory>
</VirtualHost>

$ sudo ./bin/apachectl restart

$ for user in test{1..3}; do
      echo -n "$user: "
      curl --head --silent --user $user:$user \
         http://localhost:81/ | grep 'HTTP'
 done
test1: HTTP/1.1 200 OK
test2: HTTP/1.1 401 Authorization Required
test3: HTTP/1.1 401 Authorization Required


What am I missing?
Thanks for your time. More details upon request.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to