Can I have two AuthUserFile directives in an apache2/sites-enabled/000-default configuration file?
<Location /repo/trac>
AuthType Basic
AuthName "Trac"
AuthUserFile /etc/apache2/passfile1
AuthUserFile /etc/apache2/passfile2
Require valid-user
</Location>
I want username/password for two types of users.
- DEV – can access SVN and Trac
- NOM – can only access Trac
I have two options: keep separate password files for Trac and Svn and include them separately, or have 2 password files in 1 I put DEV in other NOM and include only 1 for svn and include two under trac location.
You should move everything into a single password file and then use groups to control access to particular resources. You can create
/etc/apache2/groupswith contents along the lines of:And then modify your configuration so it looks like this:
This would allow members of the
DEVandNOMgroups to access this resource.If you really want to use multiple password files, see the documentation for mod_authn_alias, which has an example that does exactly this.