Results 1 to 3 of 3
  1. #1

    Apache Basic Auth with multiple AuthUserFiles?

    I am working on a project where users can subscribe to either full site access or access to a certain file selection for a lower price. I am wondering how to change the following .htaccess entry:

    <Files 6.wmv>
    AuthType Basic
    AuthName "Bright Video Number 6"
    AuthUserFile "/home/bright/accounts/subscribe-oneweek/passwd-6"
    AuthUserFile "/home/bright/accounts/passwd"
    require valid-user

    So that access will be given if the user supplies credentials matching an entry in either one or the other of the passwd files. As it is now a second AuthUserFile entry will only override the first and Apache will only look for the credentials in the file defined second, instead of checking both passwd files.

    Btw, this is a site for educational videos, not a porn site.

  2. #2
    Join Date
    Jun 2003
    Heh, I was about to crack a porn site joke until I saw that last line. :)

    I don't think that there's any way to do that, short of changing Apache's source. As an easy workaround, why not just add the full subscribers to the partial subscriber file, and only use that one to protect files to which both groups should have access?

  3. #3
    Join Date
    Nov 2003
    Marylebone, London, UK
    you can combine AuthUserFile with AuthGroupFile,
    and in the latter you can have two groups, 'full'
    and 'partial' say. depending on what user has signed
    up for you add the username to the appropriate group.

    the while site would use
    require group full

    and for a subdirectory, you can have
    require group full partial

    inside suitable Directory block

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts