wiki:password_protect_site_htaccess
This is an old revision of the document!
Table of Contents
Password protect site with htaccess
Create the Password File
apt-get install apache2 apache2-utils htpasswd -c /etc/apache2/.htpasswd <username>
In vhost conf add:
AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd Require valid-user
Example:
<Directory /var/www/example> AllowOverride All Options FollowSymlinks AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd Require valid-user </Directory>
Do it for both non-ssl and ssl vhost configuration
Check conf and reload web server
apachectl -t systemctl reload apache2
References
wiki/password_protect_site_htaccess.1610976495.txt.gz · Last modified: 2021/01/18 13:28 by antisa