Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save laszlomiklosik/8c5f1d12e6d6759abff3 to your computer and use it in GitHub Desktop.
Save laszlomiklosik/8c5f1d12e6d6759abff3 to your computer and use it in GitHub Desktop.
Apache2 Basic Authentication config example
# Add the below in the VirtualHost section (in apache2.conf of the sites-enabled/* file):
<Location />
Deny from all
AuthUserFile /usr/local/etc/httpd/users
AuthName authorization
AuthType Basic
Satisfy Any
require valid-user
</Location>
# Then create a user / password combination using:
sudo htpasswd -c /usr/local/etc/httpd/users chosenUserName
# and when prompted set a password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment