I'm configuring some htaccess files for multiple directories and I'm having some problems incorporating groups of authorized users.
Say there's 4 directories with protected content in each: 2005, 2006, 2007, 2008
The people that have access are subscribers. Some users have access to all directories, and some users have access only for some. Access is granted based on password or IP address/range.
For this situation I have an .htaccess file similar this in each directory:
AuthType BasicAuthName "2008 Subscriptions"AuthUserFile /path/to/password/file/2008.pwrequire valid-userSatisfy anyorder deny,allowallow from 123.123.123.123allow from 223.223.223.223allow from 123.156.0.0/16and so onand so onand so ondeny from all
This works perfectly for the situation described above.
The IP addresses in the .htaccess files and users in the password files are pretty static. Once they are in there, they usually stay. However, there is a small group of people, we'll call them editors, that is very dynamic. People are constantly being added to and removed from this list. These editors should have access to all 4 directories. Currently they are given access permission via the password file shown above. This means that if an editor is added or removed, I have to make the change in 4 different files. Sometimes they are accidentally not added or removed to all the lists and then they complain and somebody has to fix it with a lot of back and forth and yada yada.
I want to set up a group just for the editors. I want to have just one list that I have to edit instead of 4 whenever a change is made.
However, from what I find in my searching, the way to add groups is to add the line:
AuthGroupFile /path/to/editors/file/.htgroup
and inside this file add something like:
editors: john sally joe
My questions:
How do I assign passwords to these users?
Does this mean that in addition to maintaining this htgroup file, I need to assign and maintain another password file as well?
-If so, that isn't what I want because I only want to have to edit ONE file for the editors, NOT TWO.
Is this possible?
Am I going about this the wrong way?
Is editing two files (independent of the number of protected directories) really such a big deal? If it is, why not just create a simple shell script that modifies both files for you?
posted by teraflop at 9:50 AM on July 11, 2008