![lighttpd auth-require 基于每个主机](https://linux22.com/image/560920/lighttpd%20auth-require%20%E5%9F%BA%E4%BA%8E%E6%AF%8F%E4%B8%AA%E4%B8%BB%E6%9C%BA.png)
是否可以使用auth.require
类似下面的主机条目指令?
$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
其中一个语句时,都会得到一个无效的配置文件。
答案1
抱歉。毕竟是打字错误。以下内容运行良好:
$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"
))
}