Friday, December 29, 2006

Webdav server with lighttpd

MacOS and Windows clients can mount fileservers using WebDAV. This runs over port 80 so it will probably work anywhere on the interweb. It seems really efficient too.

I couldn't find simple instructions on how to set this up so here's my mini howto for Linux. (Sorry for the rather technical content on this one, it's really just a note to myself).
  • Get lighttpd
  • ./configure --with-webdav-props --with-webdav-locks
  • make install (as root)
  • mkdir /var/run/lighttpd
  • mkdir /var/log/lighttpd
  • /usr/local/sbin/lighttpd -f lighttpd.conf
Here is a minimal lighttpd.conf that will share your docroot for read & write.

# lighttpd configuration file for a webdav server
# in MacOSX you can mount this with http://host/
# See:

server.modules = (
"mod_accesslog" )

server.document-root = "/var/www/"

server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"

webdav.activate = "enable" = "disable"
webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db" = "/var/run/"

# at least server html pages
mimetype.assign = (
".html" => "text/html",
".htm" => "text/html"
Update: After using this as a server for a few days, I have to report that there are two issues:

  • Re-naming folders takes ages, reports an error, but does work
  • You can't cancel a file copy


Anonymous said...

Would love to hear if the problem you describe was ever fixed?


Peter Marks said...


I just grabbed lighttpd-1.4.18 and gave it another go. The folder re-naming bug is gone but it still took ages to cancel a file copy for some reason.

Otherwise, with a Leopard client, it seems really snappy to use and stable so far.

Thanks for asking.