Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to use auth.require directives with host entries like the one below?

$HTTP["host"] =~ "db\.example\.com$" {
    server.document-root = "/usr/share/phpmyadmin"
    server.errorlog = "/var/log/lighttpd/db.example.com/error.log"
    accesslog.filename = "/var/log/lighttpd/db.example.com/access.log"
    server.error-handler-404 = "/e404.php"
}

Every time I try to use auth.require from within one of those statements I end up with an invalid config file.

share|improve this question

migrated from webmasters.stackexchange.com Sep 7 '11 at 13:04

This question came from our site for pro webmasters.

1  
Please post the entire content of auth.require section? –  quanta Sep 7 '11 at 13:28
add comment

1 Answer

My apologies. It was a typo after all. The following is working well:

$HTTP["host"] =~ "db\.example\.com$" {
    server.document-root = "/usr/share/phpmyadmin"
    server.errorlog = "/var/log/lighttpd/db.example.com/error.log"
    accesslog.filename = "/var/log/lighttpd/db.example.com/access.log"
    server.error-handler-404 = "/e404.php"
    auth.require = ( "" => (
    "method"  => "digest",
    "realm"   => "dbuser",
    "require" => "valid-user"
    ))
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.