Last active
October 31, 2017 13:35
-
-
Save bastienrobert/811dcb25af1fbc380ace82be540d3697 to your computer and use it in GitHub Desktop.
Add password on your Apache server
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
AuthName "Secured page" | |
AuthType Basic | |
AuthUserFile "/var/www/.htpasswd" | |
Require valid-user |
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
# Use the following command : htpasswd -c /var/www/.htpasswd login | |
# then, enter your password | |
login:crypted_password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If it doesn't work, check your /etc/apache2/apache2.conf, AllowOverride need to be All (not None).
If you don't want to set the password on /var/www but on an other path, don't forget to change the path on .htaccess (AuthUserFile) and when you generate the .htpasswd w/ the command.