Posted by Guest as SysAdmin
There are plenty of reasons why you would want to setup an online storage solution. Whether you need to have your files accessible from anywhere, or want to share them with your friends, or to distribute your software, you will need to evaluate the many different technologies available and find the one that fits your needs and requirements.
You probably already thought about NFS, FTP, maybe SSH or even Subversion to access files in a particular directory. They all have their own set of features, advantages and particularities.
There is another one that may be worth considering: Using WebDAV over Apache.
Here are few key points that I find interesting:
Curious? Read on, and you should be able to get started quickly.
I am leaving distro-specific and technical details out on purpose, it would be useless to rewrite the excellent documentation you should be able to find online.
I tested this on a Apache server installed through yum on a CentOS 5 server, and I used an Ubuntu 7.04 client to mount the directory locally (I had to install the davfs package with apt-get).
The Apache server I got through yum came with the mod_dav and mod_dav_fs modules already installed. Easy!
You will have to make sure that the following configuration lines are present in your Apache configuration file:
Then you will need a
<Directory /path/to/webdav/share>...</Directory> section. It should contain all the usual directives (
Allow from ...), and this one:
Allow from all
Finally you should make sure that whatever user Apache is running under (typically apache, www-data, www, or nobody) has write access to that directory.
That’s it! I told you it was simple.
Now you can mount the WebDAV shared directory on your local box:
mount -t davfs http://webdav.spry.com/shared_dir /mnt/webdav_shared_dir
This allows you to add/delete files, and read/write the existing ones.
Now you can start working as if the shared directory was part of your local filesystem.
Once you have put some files on it, just point your browser to http://webdav.example.com/shared_dir, and your files should be accessible for reading.
Congratulations! You just set up a WebDAV shared directory, accessible from anywhere.
You can use any Apache configuration directive to customize your shared directory.