- Log in to post comments
# vi /etc/apache2/sites-enabled/000-default.conf
...
AllowOverride AuthConfig
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
...
cat < /var/www/html/.htaccess
AuthBasicAuthoritative On
AuthName "Authorized Users Only."
AuthType Basic
AuthUserFile /etc/apache2/htpasswd
Require user USER_NAME
EOF
htpasswd -b /etc/apache2/htpasswd USER_NAME 'USER_PASS'