Archive for the ‘filesharing’ Category

Using Webdav to share files

Posted 17 Oct 2009 — by maxhaussler
Category apache, filesharing

I hate sending around the same text document all the time to the same people. With Google Docs still being too buggy for serious work and completely missing reference management and etherpad and zoho writer not being up to the task either, I am searching for a better solution. At school, some people used Microsoft’s SharePoint Server, which allows to open documents through the internet and also to save them back to the server, at a hefty price. It is using WebDAV as one of the supported protocols to access the files. WebDAV resembles http, except that it allows browsing folders and saving files to the server. Apache’s WebDAV module is a free implementation. You can keep your documents on a webserver, open them with Microsoft Office and OpenOffice and directly save them back on your webserver. Actually you can put all sorts of files into the WebDAV folder that you want to share with other people. The result is very similar to the commercial offer of dropbox.com, except that you don’t need to install a client and you are not limited to 2GB.

Here is how I installed WebDav on my own machine as root (adapted from the debian website):

  1. Enabled modules in apache that handle dav and authentication (Debian: “a2ensmod dav* auth_digest”)
  2. Added this to my apache configuration file (e.g. /etc/apache2/http.conf):
    Alias /dav /var/www/dav
    DAVLockDB /var/www/davLock/davLock

    AllowOverride None
    Options None
    Order allow,deny
    allow from all


    DAV On
    DAVMinTimeout 600
    AuthType Digest
    AuthName “webdav”
    AuthUserFile /etc/apache2/webdav-password
    Require valid-user
  3. Create the directories for the files and the lockfiles: “mkdir /var/www/dav /var/www/davLock”. Change owner to apache user: “chown www-data /var/www/dav /var/www/davLock” to make both writeable for the apache daemon.
  4. Create the user and the password: “htdigest -c /etc/apache2/webdav-password webdav myuser
  5. Restart apache: /etc/init.d/apache2 restart

You should then be able to access the folder from the MacOS Finder via “Go / Connect to Server” by entering your server name like http://myserver.com/das with the username myuser and the password that you specified in htdigest.

(To make webdav work with windows, see the comments below)