Skip to content

Instantly share code, notes, and snippets.

@dream1986
Created April 10, 2016 05:26
Show Gist options
  • Save dream1986/4e4a1f24c0b24d216d75e2f9e25fc78d to your computer and use it in GitHub Desktop.
Save dream1986/4e4a1f24c0b24d216d75e2f9e25fc78d to your computer and use it in GitHub Desktop.
set up webdav over lighttpd
apt-get install lighttpd lighttpd-mod-webdav apache2-utils
#install lighttpd and additional module lighttpd-mod-webdav
#apache2-utils:htpasswd to generate webdav password file, lighttpd also reuse it
chown www-data:www-data /var/run/lighttpd/
#access to www-data user and group
lighty-enable-mod auth
lighty-enable-mod webdav
#enable authorization
htpasswd -c /var/www/passwd.dav testuser
#prompt to input password
chown root:www-data /var/www/passwd.dav
chmod 640 /var/www/passwd.dav
#create users
mkdir -p /var/www/dav
chown www-data:www-data /var/www/dav
#create directory to be shared by webdav
vi /etc/lighttpd/lighttpd.conf
#reroute webdav
#server.modules = (
# "mod_access",
# "mod_webdav",#+
# #...
# $HTTP["host"] == "www.example.com" {
# server.document-root = "/var/www/web"
# alias.url = ( "/webdav" => "/var/www/dav" )
# $HTTP["url"] =~ "^/webdav($|/)" {
# 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/passwd.dav"
# auth.require = ( "" => ( "method" => "basic",
# "realm" => "webdav",
# "require" => "valid-user" ) )
# }
# }
/etc/init.d/lighttpd restart
#take effect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment