Web Hosting Talk







View Full Version : .htaccess User Authentication Problem


daintree
07-30-2001, 03:33 AM
I'm trying to setup .htaccess to password protect a directory on my server. The .htaccess file I'm using has worked previously on a Linux server but not on FreeBSD 4.3

My .htaccess looks like -

AuthName "Secure Area"
AuthType Basic
AuthUserFile /usr/local/apache/www/htdocs/members/.htpasswd

require valid-user

When I enter a valid user/password, IE responds with a DNS error. I know the page exists and is working because if I delete .htaccess, everything is OK. The page I'm trying to view does not contain any cgi/ssi - it's just a plain old .html file. How could .htaccess be causing a DNS error?

Any ideas?

TIA
Dave.

kunal
07-30-2001, 05:58 AM
hmmm... is your .htpasswd file setup correctly?

daintree
07-30-2001, 09:12 AM
I know the .htpasswd is working because it's the exact same file that I used on the Linux box which worked OK. Just to be sure, I used the htpasswd program to create a new .htpasswd file with only one entry but got the same result...

Any ideas would be appreciated.

MikeM
07-30-2001, 09:32 AM
Is apache set up to use htaccess???

Lawrence
07-30-2001, 09:40 AM
Originally posted by daintree
I know the .htpasswd is working because it's the exact same file that I used on the Linux box which worked OK. Just to be sure, I used the htpasswd program to create a new .htpasswd file with only one entry but got the same result...


We moved servers just recently and had to re-enter all users into our .htpasswd files on the new server, as the old passwords did not work. I would assume this is something to do with the Unix crypt function (used for HTAccess) being machine or platform specific or something like that.

Did you create that new .htpasswd file on the new server or old one?

daintree
07-30-2001, 10:45 AM
I know Apache is setup to use .htaccess because I'm getting the login dialog box. If I type an incorrect user/password, I get access denied. The correct password gives me a DNS error. I delete the .htaccess file and I can access the .html file no problem. This tells me that .htaccess and .htpasswd is authenticating OK but for some weird reason is causing a DNS error???

Regarding re-entering passwords - yes, I did that too. I created a brand new .htpasswd with only one entry using the htpasswd program and same thing happens.

huck
07-30-2001, 12:34 PM
Make sure the page you are trying to get is there and has the correct permissions. Also, make sure the .htaccess file is correct and that you are not getting re-directed somehow. I would be surprised if this is a real DNS issue. More likely, you are simply getting page not found errors because after authentication you are not getting directed to the correct file.

Sometimes it is good to delete and re-type .htaccess.

JohnCrowley
07-30-2001, 01:57 PM
Try making the AuthName one word "Secure_Area" with no spaces in it. This might do the trick.

- John C.

Eagle
07-30-2001, 04:02 PM
Hmm I have this too (RaQ4)
Think it has something to do with mod_gzip I recently installed?

The Prohacker
07-30-2001, 04:21 PM
In your httpd.conf make sure you have AllowOverride All set and not, AllowOverride None.

Make sure there are no returns where they shouldn't be, and also you might need to redo the .htpasswd, your new machine will have a differnt md5 salt than your old box....

Eagle
07-30-2001, 05:18 PM
nope
not working

and sun blows! i call and no more 30 day free support on my raq servers!! GRR :angry: :angry: :angry:

neil
07-30-2001, 09:52 PM
I'm just guessing here but could this possibly be a problem with your apache httpd.conf? Possibly you could attach a copy of your httpd.conf to a post.

-neil

smartbackups
08-01-2001, 05:27 PM
your httpd.conf file would help, but also do you have pam enabled on there?

MattF
08-01-2001, 05:41 PM
A DNS error??? hmm....

It sounds as if you have misconfiguration in httpd.conf (Apache's primary configuration file). Most likely you have a ServerName value that is not resolving, once you authenicate successfully Apache is directing to http://$ServerName/authenticated-area. Or such like :D

neil
08-02-2001, 04:56 PM
Originally posted by MattF
A DNS error??? hmm....

It sounds as if you have misconfiguration in httpd.conf (Apache's primary configuration file). Most likely you have a ServerName value that is not resolving, once you authenicate successfully Apache is directing to http://$ServerName/authenticated-area. Or such like :D

That's *exactly* what I was thinking!!

-neil