Lighttpd

嘗試在 lighttpd 中設置 webdav 的配置錯誤

  • July 20, 2020

我正在嘗試在 lighttpd 上設置 webdav,但我得到了一個 lighttpd.conf:解析器在文件末尾附近的某個地方失敗。webdav 配置位於文件末尾:這裡是-

$HTTP["host"] == "www.markmhart.com" {
 server.document-root = "/var/www/servers/www.markmhart.com/pages/" 
 $HTTP["url"] =~ "^/download/" {
   dir-listing.activate = "enable" 
 }
alias.url = ("/media" => "/media/mark/media")
   $HTTP["url"] =~ "^/media($|/)" {
       webdav.activate = "enable"
       webdav.is-readonly = "disable"
       webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db"
       auth.backend = "htpasswd"
       auth.backend.htpasswd.userfile = "/var/www/servers/www.markmhart.com/passwd.dav"
       auth.require = ( "" => ( "method" => "basic",
           "realm" => "webdav",
           "require" => "valid-user" ))

}

在此先感謝您的幫助。

當你正確縮進你的配置文件時,你會注意到你缺少一個右花括號:

$HTTP["host"] == "www.markmhart.com" {
 server.document-root = "/var/www/servers/www.markmhart.com/pages/" 
 $HTTP["url"] =~ "^/download/" {
   dir-listing.activate = "enable" 
 }
 alias.url = ("/media" => "/media/mark/media")
 $HTTP["url"] =~ "^/media($|/)" {
   webdav.activate = "enable"
   webdav.is-readonly = "disable"
   webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db"
   auth.backend = "htpasswd"
   auth.backend.htpasswd.userfile = "/var/www/servers/www.markmhart.com/passwd.dav"
   auth.require = ( "" => ( "method" => "basic",
       "realm" => "webdav",
       "require" => "valid-user" ))
 }

只需在最後添加:

}

引用自:https://serverfault.com/questions/1025895