[users@httpd] LocationMatch - Match Site to AuthUserFile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I posted this early yesterday but I fear I haven’t gotten a response due to my unclear explanation, sorry if I am being a pain……

 

Setup: Apache 1.3.34 on Win32

 

We have a basic authentication setup that requires separate set of users to log in to separate sites. As you can see from the setup below we are separating authentication by site. This can be tedious as we create and remove sites quite frequently. We want to implement one authorization line that will match site to AuthUserFile. We want to avoid having to add Authentication directive for every site created going forward. Is there a way to use something like regular expressions and LocationMatch to have Apache automatically match the site to the authentication file? IE: User logs to site 2, Apache automatically routes to authentication file ... "c:\data\configurations\users2.txt". I have tried doing the following with no success…

 

<LocationMatch "/live/.*/">

      AuthType Basic

      AuthName "Enter Password:"

      AuthUserFile c:\data\configurations\$1\users.txt

 

 

Thank you in advance.

.......................

 

  Alias "/site1" "c:/data/live/site1"

  <Location "/site1">

      AuthType Basic

      AuthName "Enter Password:"

      AuthUserFile c:\data\configurations\site1\users.txt

      Require valid-user

  </Location>

 

  Alias "/site2" "c:/data/live/site2"

  <Location "/site2">

      AuthType Basic

      AuthName "Enter Password:"

      AuthUserFile c:\data\configurations\site2\users.txt

      Require valid-user

  </Location>

 

  Alias "/site3" "c:/data/live/site3"

  <Location "/site3">

      AuthType Basic

      AuthName "Enter Password:"

      AuthUserFile c:\data\configurations\site3\users.txt

      Require valid-user

  </Location>

 

 

 

 

Christian Toledo


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux