Is it possible to have two password files in Apache2?

Can I have two AuthUserFile directives in 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 a username / password for two types of users.

  • DEV - access to SVN and Trac
  • NOM - Only Trac Available

I have two options: store separate password files for Trac and Svn and include them separately or have 2 password files in 1. I put DEV in another NOM and include only 1 for svn and include two under the trac location.

+5
source share
1 answer

You must move everything to a single password file, and then use groups to control access to certain resources. You can create /etc/apache2/groupswith the contents in the lines:

DEV: bob alice
NOM: norm fred bart

, :

<Location /repo/trac>
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /etc/apache2/passfile
  AuthGroupFile /etc/apache2/groups
  Require group DEV NOM
</Location>

DEV NOM .

, . mod_authn_alias, , .

+7

All Articles