htaccess and htpasswd trouble
Posted
by
hjpotter92
on Pro Webmasters
See other posts from Pro Webmasters
or by hjpotter92
Published on 2012-03-30T23:22:58Z
Indexed on
2012/04/01
5:39 UTC
Read the original article
Hit count: 206
apache2
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.
© Pro Webmasters or respective owner