Forum Moderators: phranque
I'm trying to learn authentication, but am stuffing it up somehow.
I created a user using htpasswd - for now leaving it in the bin/users
I then added the following to my httpd.conf file, restarted apache.
<Directory "C:/Program Files/Apache Group/Apache/htdocs/test">
AuthName "restricted stuff"
AuthType Basic
AuthUserFile "C:/Program Files/Apache Group/Apache/bin/users"
Require valid-user
</Directory>
When I try to access the directory test, an authentication screen pops up, but doesn't allow me access. I get a 401 error.
Apache has been working fine - handling php and sql - but I've obviously stuffed up something here.
Can anyone please help?
Welcome to WebmasterWorld!
The only thing I note is that you've used full system paths for both <directory> and for AuthUserFile, while is is more usual to see these specified as relative paths from DocumentRoot. Assuming that you used Apache's built-in password generator to create the user, I don't see any other problems.
Jim