Using Webdav to share files

3 Comments
Posted 17 Oct 2009 in 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)


3 Comments

  1. Max

    It is quite difficult to make WebDav work with windows. I've found information on it here and here. I didn't compile Mod_auth_Msfix but simply added these statements to my httpd.conf:

    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
    Header add MS-Author-Via "DAV"
    EncodingEngine on
    # this is the magic setting that mages it all automagic
    NormalizeUsername on

    In addition, our webdav username is now something like me@ourgroup, it seems that the @ in the username stops Windows from appending its domain to the credentials.

  2. Max

    We can now access our webdav server from Window's Explorer with \\servername\dav, from the the OSX Finder with Apple+K and from gnome's file browser nautilus with File / Connect to Server.

  3. Paul Johnston

    Webdav can also be used for uploading files as well as downloading, but there have been issues with certain versions of OS X which require some tweaks to get that to work.
    Paul



Add Your Comment