main

about me
pictures
links
events
sitemap
varia
woonkrediet
usage

Webdav
Grub
rpm4fc
aix
OnTrackDM6
VCDX

Currently employed @  

( clean clean )
  > main > varia > Webdav

Secure Webdav

The following is a HOWTO to setup secure WebDAV on a CentOS/Redhat based Linux server. This means the WebDAV does *NOT* need to be set to apache:apache for UID/GID access rights and hence the data can be stored securely in the user's own subdirectory with the correct UID/GID settings. There is also no need to compille as the Centos/Redhat apache binary's are re-used.

Genereal setup

The following example is based on a 2-tier model, this means in the frontend you are adviced to put an SSL enabled vhost with uses ProxyPass to contact the backend webserver. The backend webserver is configured to only allow connections from the frontend webserver.

Setup DIRS

mkdir -p /home/<username>/WEBDAV/apache-dav
mkdir -p /home/<username>/WEBDAV/apache-dav
chmod 700 /home/<username>/WEBDAV
cd /home/<username>/WEBDAV/apache-dav
mkdir conf
mkdir htdocs
mkdir logs
mkdir run
ln -s /usr/lib/httpd/modules .

Backend httpd.conf

An exaple httpd.conf can be downloaded here. Install this in the directory /home/<username>/WEBDAV/apache-dav/conf

Create password file

Execute
htdigest  -c /home//WEBDAV/.htdigest-dav "DAV Storage" 
to create a htdigest file holding your WebDAV username. Any backend for password handling off course can be chosen.

Frontend config

Add the following in your frontend vhost for your domain (preferred you enable SSL on this domain)
# Normal Proxy setup
ProxyPass               /<username>/WEBDAV/ http://<hostname>:14242/<username>/WEBDAV/
ProxyPassReverse        /<username>/WEBDAV/ http://<hostname>:14242/<username>/WEBDAV/
# Windows will drop the tailing / so we also need to setup this ProxyPass
ProxyPass               /<username>/WEBDAV http://<hostname>:14242/<username>/WEBDAV
ProxyPassReverse        /<username>/WEBDAV http://<hostname>:14242/<username>/WEBDAV

stop/start backend server

Use the following commands to stop/start your backend server:
/usr/sbin/httpd -f /home/<username>/WEBDAV/apache-dav/conf/httpd.conf -k stop
/usr/sbin/httpd -f /home/<username>/WEBDAV/apache-dav/conf/httpd.conf -k start

Accessing the WebDav

  • You can use https://<vhost>/<username>/WEBDAV/ to access the WebDAV trough https://
  • In Windows you can map a network drive an put the URL with 'different user to auth.' to map the WebDAV as a drive

Copyright 1997 - 2009 Ramses Smeyers. All rights reserved