PDA

View Full Version : Unable to get htaccess to secure directory



cvc505
07-06-2004, 04:08 PM
I am trying to use htaccess and htpasswd to secure a directory. I added the htaccess file to the directory. My htaccess file looks like:

"AuthUserFile /var/www/passwrd/.htpasswd
AuthGroupFile /var/www/passwrd/.htgroup
AuthName My Dog Did A Meep On The Rug
AuthType Basic

<LIMIT GET>
require group allowed
</LIMIT>
"
My HTpasswd looks like:

"cvc505:34TjXEUflGM"

My HTGroup loks like:
"allowed: cvc505"

When I access the directory that contains the htaccess file It will display the index.html. It does not prompt me for a password or user ID. ANy suggestio0ns?

FZ
07-06-2004, 05:38 PM
You need to name it .htaccess - note the . (dot) before htaccess!

Oh, and your AuthName, since it contains spaces, needs to be quoted:


AuthName "My Dog Did A Meep On The Rug"

Not an expert on Apache, so it might be something else wrong if not the above - let me know.

cvc505
07-06-2004, 07:54 PM
My htaccess does have the "." "dot" in front of the name and the AuthName is in quotes. but still no joy.

Thanks

wildjokerdesign
07-06-2004, 08:04 PM
Could it be the order? In a regular .htaccess file that protects using a user it looks like this

AuthName "name"
AuthType Basic
AuthUserFile /pathto/.htpasswd
require valid-user

Like Fayez I am not an expert but was just reasoning things out on what I see that does work. Not sure about adding the group auth to it. Could it be your require should look like this

require group-allowed

to reflect what is used when you require a valid user?

Just some thoughts.

FZ
07-06-2004, 09:45 PM
Also, I'm just guessing here, but is there meant to be a space after "allowed:", before "cvc505"?

jalal
07-07-2004, 02:22 AM
Have you modified your httpd.conf file?
.htaccess can be disabled in the conf file (although in a default installation it is enabled).