Webseiten sichern mit Lighttpd

Aus Weis nix

Wechseln zu: Navigation, Suche
  • um htpasswd nutzen zu können brauchen wir die apache2-utils
    • sudo aptitude install apache2-utils
  • sicherstellen dass unter server.modules "mod_auth" enabled ist
  • folgende Zeilen in die /etc/lighttpd/lighttpd.conf eintragen:

## debugging # 0 for off, 1 for 'auth-ok' messages, 2 for verbose debugging auth.debug = 2 ## type of backend # plain, htpasswd, ldap or htdigest auth.backend = "htpasswd" # filename of the password storage for plain #auth.backend.plain.userfile = "lighttpd-plain.user" ## for htpasswd auth.backend.htpasswd.userfile = "/etc/lighttpd/lighttpd-htpasswd.user"

  • Um nun ein Directory zu sichern muss der entsprechende User in das htpasswd file eingetragen werden:

sudo htpasswd /etc/lighttpd/lighttpd-htpasswd.user benutzername

  • dann in der /etc/lighttpd/lighttpd.conf den Eintrag für das Verzeichnis vornehmen :

auth.require = ( "/<verzeichnis>/" => ( "method" => "basic", "realm" => "Password protected area", "require" => "valid-user" ) )

Persönliche Werkzeuge