Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htaccess/htpasswd problem 1

Status
Not open for further replies.

gagz

Programmer
Joined
Nov 21, 2002
Messages
333
Location
US
I was running htpasswd on the command line, with -b and -c, passing the username and password. Looks like the pw file is created correctly, and my .htaccess file looks fine, but it doesn't like any passwords. Any idea?

htaccess file below:

AuthName "restricted stuff"
AuthType Basic
AuthUserFile ../.htpasswd

<Limit GET POST>
require valid-user
</Limit>

.htpasswd is the file i'm calling to create the users in (which i've verified).
 
What is the permissions on your .htpasswd file? Change it to 644 if it isn't already.

Randy
 
it was 666, but i changed it anyway. I think its reading the file, because its listing the correct realm....
 
666 is fine, as long as everybody can read them.

Did you make the appropriate changes to the AllowOverride lines in httpd.conf? I think by default they are "AllowOverride None". You will need to change these to "AllowOverride AuthConfig".
 
Other than some specific directories, its set to ALL, is that not good? Could I directory restric it to AuthConfig?
 
ALL should work fine. Sorry I can't be of more help, these two things are the only things I can remember ever changing to get Auth to work properly.


 
ugh... thanks for the help. anyone else have any insight? this is how i'm creating the user/pw, is this right?

htpasswd -b -c /usr/local/etc/httpd/users username password
 
I just setup a directory tried to password protect it and noticed the following about AuthUserFile directive. I created both .htaccess and .htpasswd in the same directory.

If I use:

AuthUserFile .htpasswd

it does NOT work, if I use the full path to my user file:

AuthUserFile /home/webmaster/test/.htpasswd

it DOES work.

Randy
 
RandyRiegel, you're my hero for today.

worked like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top