How To Set Up WebDAV With Lighttpd On OpenSUSE 11.2
How To Set Up WebDAV With Lighttpd On OpenSUSE 11.2Version 1.0 This guide explains how to set up WebDAV with lighttpd on an OpenSUSE 11.2 server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the lighttpd server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm using an OpenSUSE 11.2 server with the IP address 192.168.0.100 here.
2 Installing WebDAVYou can install lighttpd (if it's not already installed) (including the lighttpd WebDAV module) and the apache2-utils package (which contains the tool htpasswd2 which we will need later on to generate a password file for the WebDAV share) as follows: yast2 -i lighttpd lighttpd-mod_webdav apache2-utils Then we create the system startup links for lighttpd (so that lighttpd starts automatically whenever the system boots) and start it: chkconfig --add lighttpd Next, we open /etc/lighttpd/modules.conf and enable/add the modules mod_alias, mod_webdav, and mod_auth in the server.modules stanza (it is important that mod_webdav is listed before mod_auth!): vi /etc/lighttpd/modules.conf
(Please don't uncomment the line include "conf.d/webdav.conf" in /etc/lighttpd/modules.conf because /etc/lighttpd/conf.d/webdav.conf would enable WebDAV for all vhosts - I want to show how to enable it on a per-vhost basis in this tutorial instead.) Restart lighttpd afterwards: /etc/init.d/lighttpd restart
3 Creating A Virtual HostI will now create a lighttpd vhost (www.example.com) in the directory /srv/www/web1/web. If you already have a vhost for which you'd like to enable WebDAV, you must adjust this tutorial to your situation. First, we create the directory /srv/www/web1/web and make the lighttpd user and group (lighttpd) the owner of that directory: mkdir -p /srv/www/web1/web Then we open /etc/lighttpd/lighttpd.conf and add the following vhost to the end of the file: vi /etc/lighttpd/lighttpd.conf
Afterwards we restart lighttpd: /etc/init.d/lighttpd restart
4 Configure The Virtual Host For WebDAVNow we create the WebDAV password file /srv/www/web1/passwd.dav with the user test (the -c switch creates the file if it does not exist): htpasswd2 -c /srv/www/web1/passwd.dav test You will be asked to type in a password for the user test. (Please don't use the -c switch if /srv/www/web1/passwd.dav is already existing because this will recreate the file from scratch, meaning you lose all users in that file!) Now we change the permissions of the /srv/www/web1/passwd.dav file so that only root and the members of the lighttpd group can access it: chown root:lighttpd /srv/www/web1/passwd.dav Now we modify our vhost in /etc/lighttpd/lighttpd.conf so that it looks as follows: vi /etc/lighttpd/lighttpd.conf
The alias.url directive makes (together with $HTTP["url"] =~ "^/webdav($|/)") that when you call /webdav, WebDAV is invoked, but you can still access the whole document root of the vhost. All other URLs of that vhost are still "normal" HTTP. Restart lighttpd afterwards: /etc/init.d/lighttpd restart
5 Testing WebDAVWe will now install cadaver, a command-line WebDAV client: yast2 -i cadaver To test if WebDAV works, type: cadaver http://www.example.com/webdav/ You should be prompted for a user name. Type in test and then the password for the user test. If all goes well, you should be granted access which means WebDAV is working ok. Type quit to leave the WebDAV shell: server1:~ # cadaver http://www.example.com/webdav/
6 Configure A Windows XP Client To Connect To The WebDAV ShareThis is described on http://www.howtoforge.com/setting-up-webdav-with-apache2-on-debian-etch-p2. Please specify the port in the WebDAV URL, e.g. http://www.example.com:80/webdav. For some strange reason this makes Windows XP accept the normal username (e.g. test) - otherwise Windows XP expects NTLM usernames (that would have the form www.example.com\test).
7 Configure A Linux Client (GNOME) To Connect To The WebDAV ShareThis is described on http://www.howtoforge.com/setting-up-webdav-with-apache2-on-debian-etch-p3.
8 Links
|




Recent comments
1 day 3 hours ago
1 day 4 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 7 hours ago
1 day 10 hours ago
1 day 13 hours ago
1 day 14 hours ago
2 days 4 hours ago
2 days 20 hours ago