Setting Up a WebDav Server and Client

by James McLellan

You may find yourself wanting to share files with others in the development process. There are several ways to do this, each with pros and cons.

Using WebDAV has the benefits of simplicity and security. Simplicity in that if you have your firewall configured to allow web traffic, you need open no new ports. Security comes from the user accounts which access WebDAV have no access to other parts of your system, and aren't even true user accounts in the sense of shell accounts, homes, and permissions.

Sounds like fun? Here's how you do it, without taking too much time.

I. Setting Up the Server

This assumes you are running Apache. Mod_DAV may already be installed in your Apache client. If it is not, it's usually a simple matter to do so.

Go to your httpd.conf file. You should see:

LoadModule dav_module modules/mod_dav.so

LoadModule dav_fs_module modules/mod_dav_fs.so

And elsewhere in the same file:

<IfModule mod_dav_fs.c>

# Location of the WebDAV lock database.

SAVLockDB /var/lib/dav/lockdb

</IfModule>

You can then turn on DAV modules in specific directories. For example:

<Directory "/var/www/html/webcustomer/editablepages">

Dav On

<Limit PUT POST DELETE PROPFIND PROPPATCH MKCol COPY MOVE LOCK UNLOCK>

AuthType Basic

AuthName "WebDAV Login"

AuthUserFile /var/www/passwords

Require user myusername

</Limit>

</Directory>

And you would substitute myusername for your own user credentials. These credentials, you'd create with htpasswd.

htpasswd /var/www/passwords myusername

II. Setting Up The Client

Setting up the Client side under modern versions of Windows should be simple. In most cases the DAV service is already started by default. If it is not started, to start it, go to "Control Panel" and under "Administrative Tools", select "Services". Find the "WebClient" service and double-click on it to configure the service. Make sure the service is started, and if you desire, that it automatically starts in the future.

 

1. Using Microsoft Internet Explorer, select Open

2. For your web site, enter the location of your files. http://www.customerwebsite.com/editablefiles. Make sure to check the "Open as Web Folder" checkbox.

3. An initial password prompt may appear. Ignore this dialog by pressing the "Cancel" button.

4. A second password request should appear. Into this one type your username and password.

5. You should see a normal Windows folder for copying, cutting, and pasting files.