Page 1 of 1

Re: lighttpd und mod auth

Posted: 2008-02-21 09:03
by Joe User
Versuche es erstmal mit Basic-Auth:

Code: Select all

auth.backend.htpasswd.userfile = "/srv/www/htdocs/lighttpd.user.htpasswd"
auth.backend = "htpasswd"
$HTTP["url"] =~ "^nagios" {
    auth.require = (
        "/nagios" => (
            "method" => "basic",
            "realm" => "restricted area",
            "require" => "valid-user",
        ),
    )
)
Zudem ist in Deinem Config-Ausschnitt eine undefinierte Option zuviel.

Re: lighttpd und mod auth

Posted: 2008-02-21 14:32
by Joe User
Wenn Du das überflüssige '$HTTP["url"] =~ "^nagios" {' weglässt, funktioniert es auch nicht? Muss ich wohl doch meine Testinstallation hochfahren...

Re: lighttpd und mod auth

Posted: 2008-02-21 15:41
by Joe User
Folgendes funktioniert bei mir mit Lighttpd-1.4.18 unter Gentoo:

Code: Select all

# htdigest -c /etc/lighttpd/auth_htdigest.user nagios nagios
# chown lighttpd:lighttpd /etc/lighttpd/auth_htdigest.user
# chmod 0640 /etc/lighttpd/auth_htdigest.user
# tail -n 16 /etc/lighttpd/lighttpd.conf
$SERVER["socket"] == ":80" {
    $HTTP["host"] == "localhost" {
        server.name = "localhost"
        server.document-root = "/var/www/lighttpd/htdocs"
        accesslog.filename = "/var/log/lighttpd/access_log"
        auth.backend.htdigest.userfile = "/etc/lighttpd/auth_htdigest.user"
        auth.backend = "htdigest"
        auth.require = (
            "/nagios" => (
                "method" => "digest",
                "realm" => "restricted area",
                "require" => "valid-user",
            ),
        )
    }
}