: Htaccess and htpasswd trouble This is the first time that I have ever tried working with .htpasswd and .htaccess files, so please point out my childish works. I have my apache document root
This is the first time that I have ever tried working with .htpasswd and .htaccess files, so please point out my childish works.
I have my apache document root set to /www/ on my debian server. Inside it, there's a folder named Logs/ which I want to restrict access using a htpasswd. I created my htpasswd file using the shell's htpasswd command. And this is the result:
user:<encoded password here>
hjp:<encoded password here>
hjpotter92:<encoded password here>
I put this file named .htaccess inside /www/. The Logs/ has following htaccess file in it:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /www/.htpasswd
AuthGroupFile /dev/null
require valid-user
This was again created using an online tool(I forgot its name/link, and can't search the browser-history now).
The problem, as it might've already struck you is that I am experiencing no change on my Logs folder access. The folder is still accessible to everyone. I am running apache as root user(if that matters/helps). Please help/guide me. I've tried reading some htaccess guides and have followed some of older SO questions, but still haven't figured out a way to restrict access to Logs folder with a password.
More posts by @Goswami781
2 Comments
Sorted by latest first Latest Oldest Best
It looks like you got your problem solved by putting the contents of your .htaccess file into httpd.conf.
Another solution would have been to change the line in your httpd.conf from
AllowOverride None
to
AllowOverride All
Solved the problem with the help of a person i know. :)
Added this segment to httpd.conf:
<Directory /www/ChatLogs>
Allow from all
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /www/.htpasswd
AuthGroupFile /dev/null
Require valid-user
</Directory>
Because there's a line in httpd.conf as follows:
AllowOverride None
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.