Difference between revisions of "Webdav"

From Klaus' wiki
Jump to: navigation, search
(Problems)
(Mount your ownCloud)
Line 45: Line 45:
 
</source>
 
</source>
  
First observe that no errors are issued. The in another console try to access the mount point. If no error are shown in the roor console everything is fine, otherwise debug until it works.
+
First observe that no errors are issued. The in another console try to access the mount point. If no error are shown in the root console everything is fine, otherwise debug until it works.
  
 
Stop the automount by pressing Ctrl+C.
 
Stop the automount by pressing Ctrl+C.

Revision as of 14:45, 5 June 2014

WebDAV is a convenient way of handling file access through a webserver.

In order to access WebDAV drives you need to have the appropriate file system software installed.

As root:

$ yum install davfs

Mount your ownCloud

If you have a owncloud service available you can mount it using automount. Automount or autofs will automagically mount the exported webdav drive when you access the mount point.

Create a mount point as the login user you normally uses.

$mkdir -p /home/YourLogin/mounts/owncloud

As root add to the /etc/davfs2/secrets this line:

http://owncloud.YourServer.Domain/files/webdav.php YourUserName YourPassword

changing YourServer.Domain, YourUserName and YourPassword with the ones that reflects your setup.

Then in /etc/auto.master add a line like this:

/home/YourLogin/mounts/owncloud /etc/auto.owncloud.davfs uid=1000,gid=1000,--timeout=600,--ghost

again modify YourLogin with your login name.

Create the file /etc/auto.owncloud.davfs and add this:

m -fstype=davfs,rw,dir_mode=0777,file_mode=0666 :http\://owncloud.YourServer.Domain/files/webdav.php

again YourServer.Domain shall be fixed to reflect your setup.

Try it:

$ service autofs stop   #Stop any running autofs service
$ automount -f -v

First observe that no errors are issued. The in another console try to access the mount point. If no error are shown in the root console everything is fine, otherwise debug until it works.

Stop the automount by pressing Ctrl+C.

Now restart the autofs

$service autofs start

If needed see Sshfs for details about how to setup autofs.

Mount Box.net

Enter your credentials in /etc/davfs2/secrets as mentioned above. Box.net's share is https://dav.box.com/dav

Create an entry in auto.master as described above, using the Box address instead.

Create the auto.box.davfs file with content similar to the above.

Problems

I ran into several problems having SELinux preventing access to the cache files. I finally sovled the problem by issuing a rm -rf * in the /var/cache/davfs/ directory. The "left-overs" from the manual mounting was with root privileges where the user privileges are needed when letting autofs doing the job.