Password protection directory
Hi,
I want to protect one of folder which is at location httpdocs with password protection
I have tried the method of password protection using .htpassword option but it wont ask for authentication while accessing the url.
Can you please let me know what I am doing wrong.
I have used following method:
Created .htaccess file under /usr/local/apche/httpdc/Myfolder/ and added following rules into it.
AuthName " restricted access"
AuthType Basic
AuthUserFile /usr/local/apche/httpdoc/Myfolder/.htpasswd
require user admin
created user using .htpassword file creator and placed the .htpassword file into other location so that it will not accessible via browser for security purpose.
Can you please let me know what I am doing wrong.
Thanks,
Dan.
-
Hello, Is this a cPanel server? If so, is there any reason your accounts are not stored in the /home/$username directory? Have you tried using the "Password Protect" feature in cPanel? Or, is this for a system directory that you want accessible to the public? Thank you. 0 -
Hi :), Any suggestions about this case? Or need any custom settings for the same? 0 -
Hi , I am able to achieve the password protection by doing slight modification in httpd.conf as below: I have created below entry and replaced "AllowOverride None" by "AllowOverride All": =========== Options All AllowOverride All Require all granted =========== Till now no issues with the websites after I restarted the httpd service. Please let me know will it make any other effects with the above changes. Regards. 0
Please sign in to leave a comment.
Comments
5 comments