Setting up of Apache and mod_dav

The module mod_dav is included by default in the Apache 2.x sources and in its distributions for the most of popular operation systems like Windows, Red Hat, FreeBSD. When compiling Apache from sources DAV related modules can be also explicitly activated by passing -enable-dav and -enable-dav-fs options to ./configure scripts. The option
-enable-auth-digest may be provided as well. Once Apache has these modules, they should be activated in httpd.conf file:
LoadModule dav_module libexec/apache22/mod_dav.so
LoadModule dav_fs_module libexec/apache22/mod_dav_fs.so

Next, the location of the DAV lock database must be provided using DAVLockDB directive. The directory containing that lock database must be writable by the user and the group running the server. It is better to create a new directory and adjust its permissions instead of changing an existing one:

# cd /usr/local/etc/apache22
# mkdir dav
# chown www:www dav/
# chmod 770 dav/

The value of DAVLockDB in httpd.conf is then the following:

<IfModule mod_dav.c>
    DAVLockDB /usr/local/etc/apache22/dav/lockdb
</IfModule>

Optionally in the same <IfModule> DAVMinTimeout directive can be specified which controls the timeout in seconds of the WebDAV locks:

    DAVMinTimeout 600

Finally, a directory, that will be DAV-enabled, should be created:

# cd /usr/local/www/apache22/data
# mkdir firstdav
# chown www:www firstdav/
# chmod 770 firstdav/

DAV On directive is used in httpd.conf to specify that this is a DAV-enabled directory:

<Location /firstdav>
    DAV On
</Location>

Now we are ready to publish content in that directory using a suitable client.

Иван Иванов 2006-06-23