cub1cle.com

David Dean, dave.dean@gmail.com, 23 June 2006

HOWTO: Configuring Apache2/Webdav on FreeBSD 6+

What is Webdav?

It's a protocol designed to manipulate files remotely, over HTTP-style connections using HTTP-style methods

Why do I want it?

Think 'network drive', and if that sounds appealing, you want it.

Howto:

Apache Config:

Uncomment these lines in your httpd.conf:

Loadmodule dav_module libexec/apache2/mod_dav.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so

Create your new VirtualHost, or use an existing one ..

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /usr/local/www/data/remotestorage/
    ServerName example.com

    DAVLockDB /var/webdav/DBLock

    <Location />
      Dav on

      AuthType Basic
      AuthName "Restricted Files"
      AuthUserFile /usr/local/etc/apache/htpwds
      Require valid-user
    </Location>
</VirtualHost>

So the webdav specific things there are:

DAVLokDB: This is the webdav locking database. You dont need to understand it, but you DO need to choose where it lives on your server. This example is in /var/webdav/DBLock (duh)

Dav: This turns on the webdav module. Required.

And some Basic auth, so other people have trouble stealing your stuff.

Command Line Time

You need to create the "DBLock" directory. Just hit:

mkdir /var/webdav
mkdir /var/webdav/DBLock

And create your authfile for the basic auth ..

htpasswd -c /usr/local/etc/apache/htpwds user

You'll be prompted for a password. Restart apache (/usr/local/etc/rc.d/apache2.sh restart) and you're done.

Client Usage

In Konqueror, you can use the format:

webdav://example.com/

To access your new webdav folder like any other folder.

And in windows, you can add it to "My Network Places", which should be enough info to get started.

Finale

Simple, but I couldnt find a simple howto document out there, and once I got it working I figured I'd write it down.