Tuesday, January 19, 2010

Apache htaccess password

1.AccessFileName .htaccess in httpd.conf (if windows)

2.httpd.conf or vhost.conf
<directory "path/to/webfolder>
Options None
AllowOverride all
Order deny,allow
</directory>
3.htpasswd -c -b password.txt name password

4.Create .htaccess under webfolder
AuthUserFile /path/to/passwd.txt
AuthType Basic
AuthName "some text"

<limit GET POST>
require valid-user
</limit>

No comments:

Post a Comment