Apache2 htpasswd Notes for Basic HTTP(s) Auth
Creating a password file while adding a user for the first time:
# htpasswd -c /path/to/passwordfile username ^ Drop the parameter '-c' if adding a user to an existing file (or it will recreate/overwrite).
Deleting a user:
htpasswd -d passwordfile username
Website <Directory> directive in its configuration file to allow .htaccess full override:
AllowOverride All
.htaccess content (place in folder to be protected):
AuthType Basic AuthName "Only authorized access" AuthBasicProvider file AuthUserFile "/path/to/passwordfile" Require user username