Forum Moderators: phranque

Message Too Old, No Replies

Password Protecting Directory Isn't Working

         

Tom Lewandowski

6:26 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



I'm an Apache newbie, so I apologize if I shouldn't be posting here with you seasoned pros.

I'm running Apache 2 on a WinXP Pro server. I'm trying to password protect a directory; have read all the tutorials on it, and it seems easy enough to do....but it's not working -- I'm greeted with the dreaded 'Internal Server Error'.

httpd.conf settings:
AllowOverride All

.htaccess file:
AuthUserFile c:/clients/queststudios/public_html/private/.htpasswd
AuthName Private Directory
AuthType Basic

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

I then run the htpasswd utility, generate a login and password, and it's created and placed correctly in this 'private' directory along with the htaccess file. But notta....just an Internal Server Error when trying to access the directory.

I'm wondering if the path should be based on the hosts' DirectoryRoot, which is: c:/clients/queststudios/public_html. Should my htaccess file simply use /private/.htpasswd for the path to the 'private directory'?

Thanks...

Tom Lewandowski

8:08 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



I discovered the problem:

The AuthName has to be in "quotes".

jdMorgan

9:04 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tom Lewandowski,

Welcome to WebmasterWorld!

Glad you got it working!

Jim

coopster

3:34 am on Feb 17, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ditto. And correct you are ...


if the realm name contains spaces, it must be enclosed in quotation marks

Resource:
[httpd.apache.org...]

Stefan

3:46 am on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Man, that explains it... I just went through that a week ago. Couldn't figure out for the life of me what was wrong. Finally contacted tech support, (the same bunch that run this place), and through the online chat support had someone make a change that had it working. I asked, "cool, is it something different that I'll see?", they typed back, "Yes, you should be able to use this as a template for others". When I opened the file to look, I couldn't see any changes... I was baffled. Now I understand, he'd added quotes around the two words in the AuthName. Just checked, and there they are.

Many thanks for this thread, Tom. I was still confused until I read it.