WebDAV mounting under Linux

By camille

There is a tool that allows to locally mount remote DAV repositories under Linux, so it appears in the local directory tree. http://dav.sourceforge.net/

I had a really hard time trying to sort out how to make it work, given the scarce information, somethimes in contradiction with the actual system behavior. So this is a minimalistic procedure to get it running.

Note: This was on Mandriva Linux 2007. Our tutorial is aimed at mounting WebDAV URL https://dav.test.com/share/ by a simple user (“username”) so that he can actually upload files on server.

In procedures below we use # to note commands to be run as root and $ for UserName’s commands.

Preparation

  1. Install davfs2 package
  2. # modprobe coda

Test root mounting

  1. # mkdir /mnt/DAV
  2. # mount.davfs2 https://dav.test.com/share/ /mnt/DAV
  3. You should now be able to browse the /mnt/DAV and alter files in there. If not verify your server configuration.
  4. # umount /mnt/DAV

Important: There must be no “/” at end of URL. Note that if you use an alias on the http server for this WebDAV repository, it must not have an ending “/” on the server configuration file….
Allow users to mount the repository

  1. Add username to the users group, and relog it if needed
  2. $ mkdir ~/.davfs2/ ~/mnt/DAV/
  3. # cp /etc/davfs2/secrets ~username/.davfs2/
  4. # chown username: ~username/.davfs2/secrets
  5. Add the credentials to ~username/.davfs2/secrets following comments in there:
    https://dav.test.com/share username SeCret
  6. As root add the following line in /etc/fstab:
    https://dav.test.com/share /home/username/mnt/DAV/ davfs2 user,noauto 0 0

That done, UserName should be able to mount the repository using:

mount /home/username/mnt/DAV/

5 Responses to “WebDAV mounting under Linux”

  1. superk Says:

    OK I’ll try that tonite :)

  2. Julian Says:

    Totally works. Excellent, and thank you kindly.

    Julian

  3. Talkwards » Blog Archive » links for 2008-11-29 Says:

    [...] WebDAV mounting under Linux « Cam’s Blog, yes Sir There is a tool that allows to locally mount remote DAV repositories under Linux, so it appears in the local directory tree. (tags: tutorial webdav) [...]

  4. Alex Says:

    Hi,

    I am able to mount it but I am gettin hundreds of following error

    mount.davfs: open files exceed max cache size by 1653 MiBytes

    Thanks in advance.

  5. ab Says:

    I found this page because of error “mount.davfs: open files exceed max cache size”…
    I also use davfs (to backup files every night to mediacenter of gmx). I also have a huge amount of these errors. Any idea?
    Alex, did you find a solution?

Leave a Reply