Created
March 31, 2015 17:07
-
-
Save laszlomiklosik/8c5f1d12e6d6759abff3 to your computer and use it in GitHub Desktop.
Apache2 Basic Authentication config example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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