LSDF Online Storage: WebDAV: Difference between revisions

From Lsdf
Jump to navigationJump to search
(Add migration note)
Tag: Replaced
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page has been updated and migrated to the new docs site:
WebDAV or Web-based Distributed Authoring and Versioning is an extension of the Hypertext Transfer Protocol (HTTP) allowing to access files over the internet. WebDAV access to the LSDF Online Storage is provided via a cluster of servers reachable at the URL '''https://os-webdav.lsdf.kit.edu''' or '''davs://os-webdav.lsdf.kit.edu''' depending on the client used.


https://www.lsdf.kit.edu/docs/webdav-https/
__FORCETOC__


== Prerequisites ==

Please note the following requirements and restrictions when using the LSDF WebDAV service:

The WebDAV protocol in general does suport the listing of special files like symbolic links, i.e. symbolic links present in the LSDF file space will not be listed with most of the tools described on this page. Nevertheless it is still possible to access the content behind symbolic links. Therefore, it is recommended to access project directories directly, e.g. when mounting them in the file system or mapping them as network drives.


== Using WebDAV from a Web Browser ==

To access the starting page enter the following URL in your web browser
<pre>
https://os-webdav.lsdf.kit.edu/
</pre>
Project directories are accessible at the usual location:
<pre>
https://os-webdav.lsdf.kit.edu/kit/<OE>/projects/<PROJECTNAME>
</pre>
where ''<OE>'' is the name of your organizational unit, e.g. scc, and
''<PROJECTNAME>'' ist the name of the project.
Your home directory is accessible at the following URL:
<pre>
https://os-webdav.lsdf.kit.edu/kit/inst/<OE>/<USERNAME>/
</pre>
where ''<USERNAME>'' is you KIT username.



== Using the DaviX Command Line Client on Linux and Mac OS ==

The DaviX project provides a library and a set of client tools for file management over
HTTP-based protocols. The command line client tools can be either installed as a regular
package in you linux distribution, e.g. in RedHat based distributions with
<pre>
$ yum install -y epel-release
$ yum install davix
</pre>
or from the [https://dmc.web.cern.ch/projects/davix/home home page of the DaviX project].



=== Listing a Directory ===

The content of a directory or individual files can be listed with the following command:
<pre>
$ davix-ls -l davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234
Basic authentication - server is asking for username and password:
Login: xy1234
Password:
-rwxrwxrwx 0 10485760 2019-05-20 09:29:18 a_small_file
</pre>



=== Copying Files ===

To copy a file (e.g. testfile) from the WebDAV share to you local directory:
<pre>
$ davix-get davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234/testfile testfile
Basic authentication - server is asking for username and password:
Login: xy1234
Password:
Performing Read operation on: davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234/testfile
[==================================] 100% 10MiB/10MiB 0B/s
</pre>



=== Recursively Uploading Files ===

The following example shows how to recursively upload files with 6 transfers in parallel:
<pre>
$ davix-put -r6 a_directory davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234/a_new_directory
Basic authentication - server is asking for username and password:
Login: xy1234
Password:
Populating task queue for a_directory/ Files processed: 0
</pre>



=== Recursively downloading files ===

Files and directories can also be downloaded recursively. In the following example a directory tree will be downloaded recursively with 6 transfers in parallel:
<pre>
$ davix-get -r6 davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234/a_new_directory downloaded_dir
Basic authentication - server is asking for username and password:
Login: xy1234
Password:
Crawling davs://os-webdav.lsdf.kit.edu/kit/scc/xy1234/a_new_directory/ Files processed: 1
</pre>



== Mounting a WebDAV Share on Linux with davfs2 ==

davfs2 is a file system driver that allows mounting a WebDAV server as a local file system, like a disk drive. This way, applications can access resources on a WebDAV server without knowing anything about HTTP or WebDAV. davfs2 does extensive caching to make the file system responsive, to avoid unnecessary network traffic and to prevent data loss, and to cope for slow or unreliable connections.

davfs2 has a system wide configuration file ''/etc/davfs2/davfs2.conf'' and a user configuration file ''~/.davfs2/davfs2.conf''. The user configuration file is used in addition to the system configuration file when invoked by a normal user. Documentation on all options can be found in the [https://linux.die.net/man/5/davfs2.conf manual page].



=== Installation ===

On CentOS or RedHat like systems install the package davfs2 which is available in the epel repository:
<pre>
$ yum install -y epel-release
$ yum install davfs2
</pre>



=== Mounting (as root) ===

To mount an LSDF WebDAV project or user share issue the following command as root:
<pre>
$ mount.davfs https://os-webdav.lsdf.kit.edu/kit/<OE>/projects/<PROJECTNAME> <MOUNTDIR>
</pre>
where ''<OE>'' is the name of your organizational unit, e.g. scc, ''<PROJECTNAME>'' is the name of the project, and ''<MOUNTDIR>'' is a directory. For example:
<pre>
$ mkdir /mnt/my_lsdf_project
$ mount.davfs https://os-webdav.lsdf.kit.edu/kit/scc/projects/myproject /mnt/my_lsdf_project
Please enter the username to authenticate with server
https://os-webdav.lsdf.kit.edu/ or hit enter for none.
Username: xy1234
Please enter the password to authenticate user fg9068 with server
https://os-webdav.lsdf.kit.edu/ or hit enter for none.
Password:
</pre>

As an alternative it is possible to preconfigure a WebDAV mount. For the project mount described in the example above you would have to add the following line to the file ''/etc/fstab'':
<pre>
https://os-webdav.lsdf.kit.edu/kit/scc/projects/myproject /mnt/my_lsdf_project davfs rw,noauto,user 0 0
</pre>
User authentication information needs to be stored in the file ''/etc/davfs2/secrets'':
<pre>
$ cat /etc/davfs2/secrets | grep os-webdav
https://os-webdav.lsdf.kit.edu/kit/scc/projects/myproject /mnt/my_lsdf_project xy1234 ***
</pre>
Afterwards create the mount point directory and mount the share with the command
$ mount /mnt/my_lsdf_project
</pre>



=== Unmounting (as root) ===

To unmount a mounted WebDAV share issue the following command:
<pre>
$ umount.davfs /mnt/my_lsdf_project
</pre>



=== Mouting (as normal user) ===

To mount a share as an unprivileged user, the user account needs to be a member of the group ''davfs2'':
<pre>
$ usermod -a -G davfs2 xy1234
</pre>
The mount has to be defined in the file ''/etc/fstab''. To mount a project directory add for example the following line to the file:
<pre>
https://os-webdav.lsdf.kit.edu/kit/scc/projects/myproject /mnt/my_lsdf_project davfs rw,noauto,user 0 0
</pre>




>chmod 600 /lsdf/kit/inst/xy1234/.davfs2/secrets

>cat /lsdf/kit/inst/xy1234/.davfs2/secrets | grep os-webdav
https://os-webdav.lsdf.kit.edu/kit/inst/projects xy1234 ***

>mount /mnt/webdav >/dev/null 2>&1

>umount /mnt/webdav
umount: /mnt/webdav: umount failed: Operation not permitted
</pre>

You can mount the above-mentioned WebDAV share using '''sudo''' utility.

== Connection via File Manager on Linux ==

* '''Nautilus''' (Gnome)
* '''Kubuntu (Dolphin/Konqueror)''' (KDE)
* '''Xubuntu (Thunar)''' (Xfce)
* '''Lubuntu (PCManFM)'''
*



== Using WebDAV on Windows ==

To mount a LSDF WebDAV share (e.g. a project directory) and map it to a drive in windows follow the steps outlined below:

# Open a ''File Explorer'' and select ''This PC'' on the left hand pane.
# In the Menu select ''Computer => Map Network Drive''.
# Click ''Connect to a Web site that you can use to store your documents and pictures.''
# Click ''Next''
# Click ''Choose a custom network location'' and afterwards click ''Next''.
# Enter the URL to you project folder <nowiki>https://os-webdav.lsdf.kit.edu/kit/<OE>/projects/<PROJECT></nowiki>, where ''<OE>'' is you organizational unit and ''<PROJECT>'' is the name of your project directory, e.g. <nowiki>https://os-webdav.lsdf.kit.edu/kit/scc/projects/myproject</nowiki>
# Click Next
# Enter a name for the network location and click ''Next''
# Click ''Finish''



== External Links ==

* [http://savannah.nongnu.org/projects/davfs2 davfs2 project home page]
* [https://dmc.web.cern.ch/projects/davix/home DaviX project home page]


[[Category:LSDF_Online_Storage]]

Latest revision as of 10:34, 27 January 2023

This page has been updated and migrated to the new docs site:

https://www.lsdf.kit.edu/docs/webdav-https/