technical documents

basic http authentication with lighttpd

Password protection can limit access to your website or a specific sub-directory.

lighttpd.conf

Make sure you enable mod_access and mod_auth in your lighttpd.conf:

server.modules += ( "mod_access" )

server.modules += ( "mod_auth" )

htpasswd

#htpasswd -c ~/lighttpd/foo-auth.xt username

Running this command will prompt for this user's new password to store in the txt file. Combining this with a special $HTTP["host"] conditional ruleset in our lighttpd.conf will allow us to enable BASIC http authentication.