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:http://trac.lighttpd.net/trac/wiki/Docs%3AModWebDAV

server.modules = (
"mod_access",
"mod_webdav",
"mod_accesslog" )

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

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

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

server.pid-file = "/var/run/lighttpd.pid"

# 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

2 comments:

  1. Anonymous2:50 PM

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

    denise

    ReplyDelete
  2. Denise,

    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.

    marxy

    ReplyDelete