Lighttpd: htpasswd protection

.htaccesshtpasswdlighttpd

i would use an htpasswd protection for an folder of my website. I use lighttpd an i have write the following code into the lighttpd.conf

# Limit access to ispgen
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/etc/lighttpd/htpasswd/.htpasswd"
auth.require = ( "/var/www/florian-wirths.de/ispgen" =>
    (
    "method"  => "basic",
    "realm"   => "ISPGen",
    "require" => "valid-user"
    ),
)

But it works not for me. What i do wrong?

Best Answer

Provided you've created the .htpasswd file correctly, the only problem I see with your config segment is the auth.require path - this should be the relative url path you are trying to protect, not the absolute file system path. Try this:

auth.require = ( "/ispgen" =>

You may need to stick this inside of an appropriate $HTTP["host"] in your lighttpd.conf.

Good luck!