Skip to content

Instantly share code, notes, and snippets.

@evemilano
Created May 24, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evemilano/3e0649506c7ce10980259d6fae008a24 to your computer and use it in GitHub Desktop.
Save evemilano/3e0649506c7ce10980259d6fae008a24 to your computer and use it in GitHub Desktop.
Apache Directory Password Protection - /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
</VirtualHost>
@evemilano
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment