Difference between revisions of "Webdav"

From Klaus' wiki
Jump to: navigation, search
(Mount your ownCloud)
 
(7 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
</source>
 
</source>
  
==Mount you ownCloud==
+
==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.
 
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.
  
Line 20: Line 20:
  
 
<source lang="bash">
 
<source lang="bash">
http://owncloud.YourServer.Domain/files/webdav.php YourUserName YourPassword
+
http://owncloud.YourServer.Domain/remote.php/webdav YourUserName YourPassword
 
</source>
 
</source>
 
changing ''YourServer.Domain'', ''YourUserName'' and '' YourPassword'' with the ones that reflects your setup.
 
changing ''YourServer.Domain'', ''YourUserName'' and '' YourPassword'' with the ones that reflects your setup.
Line 34: Line 34:
  
 
<source lang="bash">
 
<source lang="bash">
m -fstype=davfs,rw,dir_mode=0777,file_mode=0666 :http\://owncloud.YourServer.Domain/files/webdav.php
+
m -fstype=davfs,rw,dir_mode=0777,file_mode=0666 :http\://owncloud.YourServer.Domain/remote.php/webdav
 
</source>
 
</source>
 
again  ''YourServer.Domain'' shall be fixed to reflect your setup.
 
again  ''YourServer.Domain'' shall be fixed to reflect your setup.
Line 41: Line 41:
  
 
<source lang="bash">
 
<source lang="bash">
$ service autofs stop  #Stop any running autofs service
+
$] service autofs stop  #Stop any running autofs service
$ automount -f -v
+
$] automount -f -v
 
</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.
+
or when systemd has the command over your PC
 +
 
 +
<source lang=bash>
 +
$] systemctl stop autofs.service
 +
$] automount -f -v
 +
</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 root console everything is fine, otherwise debug until it works.
  
 
Stop the automount by pressing Ctrl+C.
 
Stop the automount by pressing Ctrl+C.
  
No restart the autofs
+
Now restart the autofs (if on an older SystemV installation)
  
 
<source lang="bash">
 
<source lang="bash">
$service autofs start
+
$] service autofs start
 
</source>
 
</source>
 +
 +
or when systemd has the command
 +
<source lang=bash>
 +
$] systemctl enable autofs.service
 +
$] systemctl start autofs.service
 +
</source>
 +
 +
 +
If needed see [[Sshfs]] for details about how to setup autofs.
  
 
==Mount Box.net==
 
==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.

Latest revision as of 11:10, 18 January 2016

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/remote.php/webdav 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/remote.php/webdav

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

Try it:

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

or when systemd has the command over your PC

$] systemctl stop 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 (if on an older SystemV installation)

$] service autofs start

or when systemd has the command

$] systemctl enable autofs.service 
$] systemctl start autofs.service


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.