lighttpd und mod auth

Apache, Lighttpd, nginx, Cherokee
User avatar
Joe User
Project Manager
Project Manager
Posts: 11138
Joined: 2003-02-27 01:00
Location: Hamburg

Re: lighttpd und mod auth

Post by Joe User » 2008-02-21 09:03

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.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
Joe User
Project Manager
Project Manager
Posts: 11138
Joined: 2003-02-27 01:00
Location: Hamburg

Re: lighttpd und mod auth

Post by Joe User » 2008-02-21 14:32

Wenn Du das überflüssige '$HTTP["url"] =~ "^nagios" {' weglässt, funktioniert es auch nicht? Muss ich wohl doch meine Testinstallation hochfahren...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
Joe User
Project Manager
Project Manager
Posts: 11138
Joined: 2003-02-27 01:00
Location: Hamburg

Re: lighttpd und mod auth

Post by Joe User » 2008-02-21 15:41

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",
            ),
        )
    }
}
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.