.htaccess tutorial

htaccess Elite


Using require group and require <user> together

Anything not fitting into other categories

Using require group and require <user> together

Postby dgoadby » 15 Jul 2008 17:25

I am using Apache 2.2.2 (part of WAMP). I have a number of groups setup for controlled access. I wanted to add a single user to the permissions to single directory so I wrote something like this:

# htaccess for bcb wiki
AuthType Basic
AuthName "BCB User Password Required"
AuthUserFile c:/wamp/passwords/passwords
AuthGroupFile c:/wamp/passwords/groups
Require group special
Require user julie

Members of "special" are ok but the user julie is not recognised. If I add "julie" to the group "special" than all is ok so the username/password are valid. As this is a one-off requirement I don't want to add her to the group.

Any ideas why is doesn't work correctly?
dgoadby
 
Posts: 1
Joined: 15 Jul 2008 17:03

Re: Using require group and require <user> together

Postby Albe23 » 16 Oct 2008 13:16

For those who came here for a solution:

After long try and error my following configuration worked out:

AuthType Basic
AuthName "Secure Folder"
AuthUserFile "/home/pathto/.htpasswd"
AuthGroupFile "/home/pathto/.htgroups"
AuthzGroupFileAuthoritative Off
Require group admin
Require user noadmin1 noadmin2 noadmin3

It first tries to find a valid user of the group admin. When that fails it tries for user noadmin1, noadmin2 or noadmin3.
Means it works for all users in group admin OR for noadmin1/2/3
Albe23
 
Posts: 1
Joined: 16 Oct 2008 12:49


Return to Main