Davfs2

From SME Server
Jump to navigation Jump to search

About

Mount a WebDAV resource as a regular file system.


davfs2 provides the ability to access webdav resources like a typical filesystem, allowing for use by standard applications with no built-in support for WebDAV. davfs2 is designed to fully integrate into the filesystem semantics of Unix-like systems (mount, umount, etc.). davfs2 makes mounting by unprivileged users as easy and secure as possible. davfs2 will work with most WebDAV servers needing little or no configuration.

Installation

The epel repository has to be enabled to install davfs2 and some dependencies. See here how to enable the epel repository.


Once the epel repository has been enabled, issue the following command:

yum install davfs2 --enablerepo=epel


No further configuration is required.


Usage

Mounting a webdav resource examples:

mount.davfs http://localhost:8080/ /mnt/dav

or

mount -t davfs http://localhost:8080/ /mnt/dav


Mounting your ownCloud home

Adding a webdav resource at boot to your linux station (replace username and URL with your real values): Add the following entry to your /etc/fstab:

https://webdav.example.com /home/username/webdav davfs user,noauto,uid=username,file_mode=600,dir_mode=700 0 1


Create secrets file in your ownCloud home (replace username with your real values):

mkdir ~/.davfs2/
echo "https://webdav.example.com/remote.php/webdav webdavuser webdavpassword" >> ~/.davfs2/secrets 
chmod 0600 ~/.davfs2/secrets

Mount or unmount your ownCloud home

mount ~/webdav
fusermount -u ~/webdav