Public domain
<Directory "/var/www/html">
.
.
AllowOverride All
.
.
</Directory>
AuthUserFile /var/www/html/private/.htpasswd
AuthName "My Private DIR"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
Use -c for fist user
# htpasswd -c /var/www/html/private/.htpasswd admin
# chmod 644 /var/www/html/private/.htaccess
# chmod 644 /var/www/html/private/.htpasswd
BY: Pejman Moghadam
TAG: htaccess, htpasswd, apache
DATE: 2009-04-25 00:21:22