Tuesday, November 23, 2004

 

Enable WebDAV in Apache 2.0

Enable WebDAV in Apache 2.0

WebDAV technology allows people to read and/or write files to a remote Web server without having to use FTP. Using the HTTPS protocol, you can wrap the WebDAV transactions with SSL, which can be particularly useful.

If you're using Apache 2.0, enabling mod_dav support (the module used to provide WebDAV functionality) is as simple as compiling Apache 2.0 with the --enable-dav configure switch. You also need to create a place for the apache user (or the user the Web server runs as) to store the WebDAV locking database.

Here's an example:

# mkdir /var/davlock
# chgrp apache /var/davlock
# chmod g+w /var/davlock

Then, add the following lines to the httpd.conf file:


DAVLockDB /var/davlock/DAVlock



DAV On


Next, create the /var/www/davtest directory, which will be your initial testing ground for WebDAV. Note that we're assuming that /var/www is the top-level directory of your Web site. To ensure that http://localhost/davtest/ corresponds to the directory, choose a directory name accordingly.

After you restart the server, you should be able to use any DAV-enabled client to read and write files to http://localhost/davtest/. One command-line client that's useful for testing and debugging is the cadaver tool.

Be aware that the above example directives are suitable only for testing; if you're using WebDAV in production, or anywhere else that's publicly accessible, be sure to use appropriate access controls.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?