Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change 
notification.

The following page has been changed by noodl:
http://wiki.apache.org/httpd/Recipes/MultiUserFiles

The comment on the change is:
Mini how-to on using authn_alias to query mutliple AuthUserFiles per request.

New page:
= How to use more than one AuthUserFile per context =

Apache 2.2 has a module called 
[http://httpd.apache.org/docs/2.2/mod/mod_authn_alias.html mod_authn_alias] 
which can be used to query multiple authentication sources in a single context.

The scenario here is:

 * {{{htpasswd}}} has been used to create two separate password files
 * Any user in these files may access a given URL

There are other approaches to this problem like merging the separate files 
together, perhaps as part of the Apache init script. Otherwise one might use 
AuthGroupFile and list all users from both files. These are troublesome though 
as in the first case the Apache init script might be overwritten during an 
upgrade and the second case is just tedious.

{{{
<AuthnProviderAlias file file1>
  AuthUserFile conf/file1.passwd
</AuthnProviderAlias>
<AuthnProviderAlias file file2>
  AuthUserFile conf/file2.passwd
</AuthnProviderAlias>

<VirtualHost *:80>
  ServerName example.org
  DocumentRoot /var/www/example.org
  <Location />
    AuthBasicProvider file1 file2
    AuthName 'Area Restricted by mod_authn_alias'
    AuthType basic
    Require valid-user
  </Location>
</VirtualHost>
}}}

Reply via email to