Hello everybody. I have a problem using .htaccess files and the htpasswd program to password protect a subdirectory under my root web. Here is what I've done so far. I have modified the AllowOverride portion of the httpd.conf file to ALL. I created the .htaccess file with the following:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile passwords
require user admin
Next I tried to use the htpasswd -c passwords admin to create a new passwords file and add the user admin to it. When I did that I got an error message stating that it couldn't complete the command because the -n and -c switches conflict. I DID NOT specify the -n switch. After that I tried creating an empty passwords file and doing the htpasswd passwords admin command to add the user admin to it. This time it asks me for a password and verification, and then it errors out saying that the file is in use by another process. I couldn't find anything else using that file, and did a reboot to make sure. No matter what I do, I can't figure out how to create the passwords file. Does anyone here have any thoughts on what to try or what I may have missed? Many thanks
Question
thumper
Hello everybody. I have a problem using .htaccess files and the htpasswd program to password protect a subdirectory under my root web. Here is what I've done so far. I have modified the AllowOverride portion of the httpd.conf file to ALL. I created the .htaccess file with the following:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile passwords
require user admin
Next I tried to use the htpasswd -c passwords admin to create a new passwords file and add the user admin to it. When I did that I got an error message stating that it couldn't complete the command because the -n and -c switches conflict. I DID NOT specify the -n switch. After that I tried creating an empty passwords file and doing the htpasswd passwords admin command to add the user admin to it. This time it asks me for a password and verification, and then it errors out saying that the file is in use by another process. I couldn't find anything else using that file, and did a reboot to make sure. No matter what I do, I can't figure out how to create the passwords file. Does anyone here have any thoughts on what to try or what I may have missed? Many thanks
--Thumper
Link to comment
Share on other sites
4 answers to this question
Recommended Posts