Apache Authentication

, , 1 Comment



Creating Password

Create htpasswd file for current (pwd) path

htpasswd -mc .htpasswd yourusername

Insert new password Create .htaccess file for current path

touch    .htaccess
mcedit .htaccess

Paste this lines to .htaccess file

AuthName "Login to the Private Area"
AuthType Basic
AuthUserFile /var/www/html/{protected_dir}/.htpasswd
Require user {username}
 

One Response

Leave a Reply