Jabber Support
     Introduction
     Search
     FAQs
     Knowledge Base
     Jabber Documents

WEBDAV Setup for Jabber File Transfers

This file contains instructions for mod_dav installation and configuration to enable Jabber client file transfers. This write-up assumes a basic knowledge of Apache and Apache module configuration. It is assumed that Apache is present on the desired server and that appropriate DNS names have been set up. Sample configurations below are from a 1.3 version of Apache.

Introduction

Mod_dav is an Apache module which allows the Jabber client to do HTTP PUTs and GETs as a means of transferring files. The official website for mod_dav is located at http://www.webdav.org/mod_dav/. Please check this site for updates and additional documentation.

File transfers via Jabber clients do not require any changes to the Jabber server. It is purely a client-side enhancement. The mod_dav method of file transfers offers users behind strict firewalls to PUT files via http to a web-based file repository. The client notifies the recipient, and the recipient thus performs a GET via http over port 80 to retrieve the file. These http PUTs and GETs are allowed by most proxies and firewalls.

Installation

Full installation instructions for mod_dav are available at http://www.webdav.org/mod_dav/.

Configuration

If you built mod_dav as a dso, you will need to load the module in your httpd.conf file:

# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule dav_module         libexec/libdav.so
AddModule mod_dav.c

Now for the main configuration. Below is a sample of all directives specified for the file transfers we've enabled through files.jabber.com. If mod_dav is the only service offered on this Apache installation (if you are hosting no other sites with this configuration), all of these directives can replace the defaults in the sample httpd.conf file distributed with Apache. If multiple sites are hosted on this Apache server, the following section should be contained within a directive.

DocumentRoot "/usr/local/apache/davdir"
ServerName files.jabber.com
ErrorLog "/usr/local/apache/logs/files.jabber.com-error_log"
LogLevel info
CustomLog /usr/local/apache/logs/files.jabber.com common
Options None
DirectoryIndex 12351642iothqlegjkhaklwjgh24o8hgtkashudglkas

<Directory /usr/local/apache/davdir>
	AllowOverride None
 	ForceType text/plain
 	Order allow,deny
 	Allow from all
	DAV On
	<LimitExcept GET POST HEAD OPTIONS>
	</Limit>
</Directory>

DAVLockDB /usr/local/apache/var/DAVLock

Below is an explanation of the directives:

DocumentRoot "/usr/local/apache/davdir"
# the base directory where file transfers will reside

ServerName files.jabber.com
# the name of the server instance. This can be an IP address
# as well as fqdn.

ErrorLog "/usr/local/apache/logs/files.jabber.com-error_log"
LogLevel info
CustomLog /usr/local/apache/logs/files.jabber.com common
# Logging info. 

Options None
# disables options for this server or virtual host. Options
# like "Indexes", "Includes" and "ExecCGI" should be disabled
# because they could potentially allow people to browse
# files that others had transferred, transfer a file containing
# server-side includes and then browse to that page and 
# execute those includes, etc.

DirectoryIndex 12ow20-n32iothqlegjkhaklwjgh24o8hgtkashudglkas
# This simply disables the recognition
# of index.html/welcome.html files as the directory index.

<Directory /usr/local/apache/davdir>
	AllowOverride None
# If someone uploads a .htaccess file with altered directives,
# this will not allow it to override any of the current settings.

 	ForceType text/plain
# Disables the potential for users to upload php scripts or
# other potentially executable files.

 	Order allow,deny
 	Allow from all
# Does not limit which users/hosts/IPs can access the server

	DAV On
# Enable the DAV module. This is important.

	<LimitExcept GET POST HEAD OPTIONS>
	</Limit>
# Only allow basic HTTP requests

</Directory>
DAVLockDB /usr/local/apache/var/DAVLock
# This is a required component for the dav module

Once your httpd.conf file is configured, you will have to create a directory specified by the DAVLockDB directive to contain the DAVLock files. The module does not seem to create its initial lock file properly, so often it is necessary to "touch /usr/local/apache/var/DAVLock.dir" prior to operation. Make sure that the directory has rwx permissions for the user your httpd process runs as. Likewise, verify that your DocumentRoot directory has the same permissions and ownership.

At this point you should be able to start up Apache without errors. To verify that the dav directory is accessible, create a test file within the DocumentRoot (e.g. a file named "test.html" containing basic html like "<html><body>test</body></html>") and then point your browser to that specific file (since we've disabled indexing, you will only be able to view files if you specifically know the file name). If the test page appears, everything should be all set.

Directory Cleanup

On files.jabber.com, we have written a shell script that will delete files within the dav directory that are older than 3 hours. This script is run as a cron job every 5 minutes and ensures that the hard drive does not fill up with old files. If you would like a copy of this script (entitled davclear.sh) feel free to e-mail jmeyering@jabber.com or request it from a Jabber, Inc representative.

Last updated: 2001-10-31



Back to Knowledge Base Index

*************

About this Site | Jabber, Inc. | Privacy and Acceptable Use Policy | Webmaster

© 2000-2005 Jabber, Inc. Jabber™, JIM™ and the JIM lightbulb design™ are trademarks of Jabber, Inc. Other marks may be owned by their respective companies.