Apache Authentication

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}
Tags:,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.