0

I'm trying to setup webdav on lighttpd but I'm getting a lighttpd.conf: parser failed somewhere near here at end-of-file. The webdav config is at the end of the file: here it is-

$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" ))
 
}

Thanks in advance for your help.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940

1 Answers1

0

When you indent your config file properly you'll notice that you are missing a closing curly brace:

$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" ))
  }

Just add it at the end:

}
Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
  • OK that fixed the problem. However, when I do a cadaver I get a Cannot open collection - 404 not found. The path and files are good. They are chown to nobody:nogroup and are set to 755. First I changed the realm to media fromwebdav and tried with no luck, then I took out all the security stuff and tried with no luck. Any ideas? – user3670606 Jul 20 '20 at 22:09
  • I'll go ahead and post this as a new question and see if I can get any answers. – user3670606 Jul 21 '20 at 03:36
  • That's a separate question, so you did the right thing to post it separate. If this solved your problem please accept the answer by clicking on the checkmark on the left side of the answer, so your question is marked as "solved" in the system. – Gerald Schneider Jul 21 '20 at 06:00