Space Menu Home Downloads Newbie Area Documentation Knowledge Base E-Training Forum Blogs Chat RPMs Farm Linux Events
HistoryHistory |
View
Code | XML |
Help
XWiki Syntax |


Did you know…

Published by Admin on Tuesday, March 22 2005 @ 04:59:54 CET

Accessing WebDAV Resources

WebDAV , the 'Web Distributed Authoring and Versioning Filesystem', "is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers." It is an open standard and supported by MS Windows, Mac OS X and Linux.
It is superior to FTP in that it allows for strong encryption, proxy support, multiple transfers per connection and is less of an security nightmare FTP undoubtedly is.

The most prominent provider of WebDAV shares so far is Apple. If you are a registered Apple user, you can get an account on Apple's servers, the so-called 'iDisk'.

In order to access your WebDAV share from Linux, you have two possibilities: either you use an ftp-like command line client, or you mount that share to your local machine.

The first method only takes two steps:

  • Installing the cadaver WebDAV client from your Mandrake Linux CD:
urpmi cadaver
  • Connecting to WebDAV server and share
cadaver http://server/share

In case of the iDisk, the server name is 'idisk.mac.com' and the share name is your iTools user name. You will be prompted for your user name and password and then connected.

Type help on the 'cadaver' prompt to get a list of available commands. If you've ever used a command line FTP client like 'lftp' or 'ncftp', you will feel right at home.

The second method, mounting the remote WebDAV share to the local system, is a bit more involved. You have to download and compile the davfs kernel module. If you are new to compiling source code, please read my primer on Compiling Source Code first.

Currently, the latest version of davfs is 0.2.4. If you are compiling this module on an 8.1 or older Mandrake Linux release, you have to make a small change to one of the source files in order to get the module to compile.

  • Open 'davfs/inode.c' in an editor and go to line 620 (it's at the end of the file).
  • Put a hash ('#') sign in front of these lines:
    MODULE_AUTHOR("Sung Kim ");
    MODULE_DESCRIPTION("Web Distributed Authoring and Versioning Filesystem");
    MODULE_LICENSE("GPL");

    and save the file.
Run configure, make and make install (as 'root') to compile and install the module. If you want SSL support in davfs, run configure like this

./configure --with-ssl=/usr

make sure you have the 'libopenssl0-devel' package installed, then.

To make things a bit easier now, set up a symbolic link from '/usr/local/sbin/mount.davfs' to '/usr/sbin/davmount' as 'root':

ln -s /usr/local/sbin/mount.davfs /usr/sbin/davmount

Now you're almost there. All you need is an empty local directory to mount the ~WebDAV share to. How about '/mnt/dav'? As 'root':

mkdir /mnt/dav

Now mount the share (as 'root'):

davmount http://server/share/ /mnt/dav

Notice that the share name has to have a trailing slash.
You will be prompted for your user name and password, then the share will be mounted. Use 'ls' or your favorite file manager to browse it via '/mnt/dav'.

In order to unmount the share, run (as 'root')

umount /mnt/dav

In this standard setting, all users have read-only access to the mounted share, only 'root' has read/write access. In order to grant a user or a group of users write access to the share, you can use the '-U' or '-G' options. To grant local user 'tom' write access to the share:

davmount http://server/share/ /mnt/dav -Utom

Notice that the documentation included in the davfs archive ('doc/HOWTO.txt') should be taken with a grain of salt. I found it rather confusing if not dangerous. Especially do not provide your password via the '-p' option to the 'davmount' command! If you do this, everyone with access to your process table (i.e. every local user) will be able to read it.

(Special thanks to Phil Lavigna, whose article about ~WebDAV on ~MandrakeForum was a great inspiration for this article.)

Revision / Modified: Mar. 08, 2002
Author: Tom Berger

Legal: This page is covered by the GNU Free Documentation License . Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.

 
Comments: 3 comments ...
 
 

RSS
KB.WebDavResourcesAccess en Last Author: pepexxj  Date: 2006/05/02 00:23
Powered by XWiki
Copyright (c) 2006 Mandriva