WebDav on Apache

RHEL5 and CentOS5 onwards come with the standard mod_dav modules, all that is required is some changes to httpd.conf to switch on webdav. Open /etc/httpd/conf/httpd.conf
 	LoadModule dav_module modules/mod_dav.so
	LoadModule dav_fs_module modules/mod_dav_fs.so
	< IfModule mod_dav_fs.c>
	# Location of the WebDAV lock database.
	DAVLockDB /var/lib/dav/lockdb
	
	< IfModule mod_dav.c>
	    LimitXMLRequestBody 131072
	    Alias /webdav "/home/webdav"
	    < Directory /home/webdav>
	        Dav On
	        Options +Indexes
	        IndexOptions FancyIndexing
	        AddDefaultCharset UTF-8
	        AuthType Basic
	        AuthName "WebDAV Server"
	        AuthUserFile /etc/httpd/webdavusers
	        Require valid-user
	        Order allow,deny
	        Allow from all
    
 
Create Webdav directory for hosting files
 mkdir -p /home/webdav
chown apache:apache /home/webdav
Add users to password file
 htpasswd -c /etc/httpd/webdavusers ananth
Restart Apache
 /etc/init.d/httpd restart
Access on windows
Windows XP / 2003 server or higher have WebDAV client. Open My network places and click Add network place. Enter the WebDAV URL (e.g. http://yourdomain.com/webdav). This will ask for the username and password setup using htpasswd.

Access in Linux KDE supports WebDAV by just using URLs that start with webdav:// or webdavs://. On command line a tool called cadaver is available.

Back to Resources