http://www.linuxplanet.com/linuxplanet/tutorials/7314/1
Easy Linux Fileserver With WebDavWebDAV and Apache2March 8, 2011 You don't need some big fancy expensive groupware suite for simple file sharing; just set up a good stout Linux server with WebDav and be done with it. No muss, no fuss.
Unlike FTP, HTTP provides strong authentication and encryption, as well as caching and proxy support – and because WebDAV works over HTTP, this means that WebDAV gets all of that for free. SSH would be another option, but SSH is a bit more limited in terms of moving files around, and certainly doesn't have the same sort of client support and tools available. WebDAV and Apache2It's straightforward to get an Apache server to serve up a WebDAV folder. The Apache module you want is mod_dav. To enable this on a Debian/Ubuntu system, just type: a2enmod dav a2enmod dav_fs /etc/init.d/apache2 restartmod_dav provides the server with the WebDAV functionality (i.e. it implements the relevant HTTP protocol extensions), and mod_dav_fs supports it, allowing access to resources in the server's filesystem. Further detailed information on the dav and dav_fs modules is available from the Apache webpage. You'll also need to set up specific folders to access via WebDAV. Here's an example: The most important line here is Dav On, which turns this directory into a WebDAV one. The rest is about securing access to the directory. It's important to make sure that you have authentication set up before you enable WebDAV on any directories, or you'll have a big security hole. The config here uses MD5 Digest authentication (recommended over htaccess for security), and would limit all access to the named user. You could also use just require valid-user; or you can make your setup as complicated as MD5 Digest allows. Note that to allow writing to (as well as reading from) your directory, you'll need to change the permissions on that directory appropriately. In particular, you need the directory to be writeable by the Apache user. Again, note the security issues here! It's a good idea to keep your WebDAV directory reasonably separate from the rest of your website files. To set WebDAV up manually, you'll need to have the following somewhere in your Apache conf file:
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
DAVLockDB ${APACHE_LOCK_DIR}/DAVLock
Then restart Apache, and set up the directory you want to use as above.
|