Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer

 
discard

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