KevinReichard
07-17-2002, 03:08 PM
These talkbacks are in response to the article Using .htaccess Files with Apache (http://www.serverwatch.com/stypes/servers/article.php/1127711).
Woojin Lee
I force authentication at root directory via .htaccess file, but want to grant unlimited access for one of the sub-directory. Could any one point me to right direction?
Afkamm responds:
I think you want to use "Require valid-user" in your .htaccess file. This will grant access to all users.
To restrict access to only a few users then use groups "Require group group-name [group-name] ..." and have those users in a .htgroups file.
http://httpd.apache.org/docs/mod/core.html#require
sonic writes:
hi there,
I have some question about .htaccess setting
I have no problem of having .htaccess working
but i am wondering, if I got 5 users - john, mary, peter, sam, jo
and i already set up .htpasswd
and my setting of .htaccess is:
AuthName 'Protected Directory'
AuthType Basic
AuthUserFile /somewhere/.htpasswd
Require user john mary peter sam jo
It is working without any problem
but is there any other method, so that every time when there is a new user, apart from adding a new entry to the .htpasswd, i no need to update each .htacess manually???
i mean is it compulsory that I have to set the line Requirer user (specify the user name)?
can the .htaccess look up from the name file automatically, instead of I need to type in the name (hardcode) manually?
[I]Afkamm responds{/I]
Instead of "Require user john mary peter sam jo" you can have "Require valid-user", this will grant access to all the usernames in the .htpasswd file which is then the only file you need to modify when new users get added.
Now i'm not sure on this, but you could try just having the one .htpasswd file and changing the "UserFile /somewhere/.htpasswd" (you don't use AuthUserFile, that just a spelling error?) in each .htaccess file to point to it. If not then it'll just be a case of editing one .htpasswd file and uploading it to all the necessary folders.
To only grant some users access to certain folder then you could start using groups (.htgroup)"AuthGroupFile /somewhere/.htgroup", "Require group group-name"
Woojin Lee
I force authentication at root directory via .htaccess file, but want to grant unlimited access for one of the sub-directory. Could any one point me to right direction?
Afkamm responds:
I think you want to use "Require valid-user" in your .htaccess file. This will grant access to all users.
To restrict access to only a few users then use groups "Require group group-name [group-name] ..." and have those users in a .htgroups file.
http://httpd.apache.org/docs/mod/core.html#require
sonic writes:
hi there,
I have some question about .htaccess setting
I have no problem of having .htaccess working
but i am wondering, if I got 5 users - john, mary, peter, sam, jo
and i already set up .htpasswd
and my setting of .htaccess is:
AuthName 'Protected Directory'
AuthType Basic
AuthUserFile /somewhere/.htpasswd
Require user john mary peter sam jo
It is working without any problem
but is there any other method, so that every time when there is a new user, apart from adding a new entry to the .htpasswd, i no need to update each .htacess manually???
i mean is it compulsory that I have to set the line Requirer user (specify the user name)?
can the .htaccess look up from the name file automatically, instead of I need to type in the name (hardcode) manually?
[I]Afkamm responds{/I]
Instead of "Require user john mary peter sam jo" you can have "Require valid-user", this will grant access to all the usernames in the .htpasswd file which is then the only file you need to modify when new users get added.
Now i'm not sure on this, but you could try just having the one .htpasswd file and changing the "UserFile /somewhere/.htpasswd" (you don't use AuthUserFile, that just a spelling error?) in each .htaccess file to point to it. If not then it'll just be a case of editing one .htpasswd file and uploading it to all the necessary folders.
To only grant some users access to certain folder then you could start using groups (.htgroup)"AuthGroupFile /somewhere/.htgroup", "Require group group-name"