vaheeD khoshnouD

linux, mikrotik, macosx

htaccess and htpasswd in Apache server

Written by vaheeD on December 28, 2012
4.00 avg. rating (83% score) - 1 vote


<Directory "/var/www/html">
AllowOverride All


AuthUserFile /var/www/html/private/.htpasswd
AuthName "My Private DIR"
AuthType Basic
<Limit GET POST>
require valid-user

Add user

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


4.00 avg. rating (83% score) - 1 vote

Posted Under: Linux, Macosx

About vaheeD

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam