This is a small tutorial in setting up WebDAV with Apache2. I have implemented it on Centos 5.0.
WebDAV – Web-based Distributed Authoring and Versioning, allows one user to edit the files directly on the server rather than downloading and then uploading the files to the server. Install `apache` web server. Just need to make some changes in the `httpd.conf` file.
Enable the following modules in the `httpd.conf` file.
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
Noe, you need to create the directory where you want users to upload the files. Suppose I assume that you have a partition `/data` on the server.
root@ophiophagus:~#mkdir backup <- inside the /data partition.
Ensure that the ownership for the /data parition is `apache`.
Now you need to create a virtual host entry for the `WebDAV`. Before that, create the WebDAV username/password file.
root@ophiophagus:~#htpasswd -c /data/backup/passwd.dav testuser
Change the ownership as well as the permission of the file. Now create a virtual host entry for the directory.
Options Indexes MultiViews
allow from all
Alias /backup /data/backup
AuthName “Admin Server”
Just reload `httpd`.
There is a utility tool for testing WebDAV from command line. Download and install and application called `cadaver`.
Authentication required for webdav on server `Admin Server’:
This will list the files which are there in the particular directory.
Note: I am still looking for a option to limit the user file upload, depending upon the file type extension, but I still not able to figure this out.