Last active
August 29, 2015 14:09
-
-
Save timkinnane/6b25d963b00f97a429dd to your computer and use it in GitHub Desktop.
Change .htpasswd setting (specifically on Digital Ocean droplets).
Note This is a shell snippet but it can't be executed as is. Step 2 is manual.
This file contains 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
# 1. Use htapasswd to set new pass for admin | |
sudo htpasswd /etc/apache2/.htpasswd admin | |
# 2. Update /etc/apache2/apache2.conf with folders to be protected | |
<DirectoryMatch ^.*/protected-folder/> | |
AuthType Basic | |
AuthName "Restricted Area" | |
AuthUserFile /etc/apache2/.htpasswd | |
Require valid-user | |
</DirectoryMatch> | |
# 3. Restart Apache | |
sudo service apache2 reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment