HTTP authentication (snippet)

April 15th, 2011 § 0 comments § permalink

And the reason for that faff is to start using this blog more to keep track of snippets of code and config that I’m constantly re-using. That is, the things you have half inside your head anyway, but need to look up exactly what the command is.

One from today: setting up basic HTTP Authentication with Apache:


vps:/etc/apache2/sites-enabled# htpasswd -c /etc/apache2/anaad.passwd admin
New password:
Re-type new password:
Adding password for user admin

edit .htaccess:


AuthType Basic
AuthName "Anaad"
AuthUserFile /etc/apache2/anaad.password
Require valid-user

Where Am I?

You are currently browsing the snippets html apache sysadmin category at Dan O'Huiginn.