Skip to content

Instantly share code, notes, and snippets.

@hfknight
Last active August 29, 2015 14:01
Show Gist options
  • Save hfknight/decfc1e5934b350b8389 to your computer and use it in GitHub Desktop.
Save hfknight/decfc1e5934b350b8389 to your computer and use it in GitHub Desktop.
Apache HTTP Server: password authentication
1. htpasswd -c /usr/local/apache/passwd/passwords <username1>
htpasswd /usr/local/apache/passwd/passwords <username12>
2. httpd.conf, add the following inside <Directory ....> section
AuthType Basic
AuthName "<Authentication Realm>"
# (Following line optional)
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
#Require user <username>
Require valid-user #multiple users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment