I’ve recently been using VoodooPad as a note taking and organization tool. I’m enjoying using it and find that the combination of Wiki-like organization, editing and linking of content combined with the responsiveness of a desktop application works very well for me.

As a user of both desktop and laptop computers, I quickly ran into the need to synchronize my two VoodooPad instances. Since VP stores all your notes in a single file (actually an OS X package) my first thought was to drop it in my DropBox folder and be done with it. This could work fine but you’ve got to be extremely careful to not change your document in multiple places—the DropBox mechanism has no idea how to synchronize changes within the documents.

Fortunately VP has built in support for synchronizing with a WebDAV server. VP’s developer directs folks to MobileMe as a readily available WebDAV server, but I don’t have an account there and don’t have much interest in subscribing. That left me with the option of setting up my own WebDAV server. The documentation points users to a great article by Manas Tungare which describes how to set up WebDAV on Mac OS X for use with another program, OmniFocus.

This article gave me everything I needed to quickly get a WebDAV server set up on my system. What follows here is my remix of Manas’ article, with a few tweaks that better accommodate my preferences and VPs capabilities, especially in the security arena.

Setting up WebDAV on Mac OS X for use with VoodooPad

Step 1: Enable Web Sharing in OS X

WebDAV is a protocol for storing documents to a Web server, so we’ll need to get one of those set up. Fortunately Mac OS X has the Apache Web Server built-in. Just go to System Preferences > Sharing and check the box labeled Web Sharing.

Web Sharing Control Panel

Step 2: Enable WebDAV support in Apache

Edit the file /etc/apache2/httpd.conf, (remember to use sudo to edit it) and locate this line:

LoadModule dav_module libexec/apache2/mod_dav.so

Make sure it is not commented out (there should be no “#” at the beginning of the line.)

Next, locate this line (towards the bottom of the file):

Include /private/etc/apache2/extra/httpd-dav.conf

Again, make sure it is not commented out. It is disabled by default, so you need to remove the “#” from this line.

Finally, because we will use digest authentication here, go back up to the LoadModule section of the file and make sure that auth_digest_module is being loaded. You are looking for the following line, and want to make sure it is not commented out.

LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so

The stock Snow Leopard config file has it enabled, so chances are you won’t need to make any changes.

Step 3: Configure WebDAV

Next, edit the file /etc/apache2/extra/httpd-dav.conf. Add a section in it to create your new WebDAV share. Here’s what the new section should look like. As a security precaution, you should also go ahead and delete the /usr/uploads share that is set by default.

Alias /webdav "/Library/WebServer/WebDAV"
Dav On
 
<Directory "/Library/WebServer/WebDAV">
   Order Allow,Deny
   Allow from all
 
   AuthType Digest
   AuthName WebDAV-Realm
   AuthUserFile "/usr/var/webdav.passwd"
</Directory>

With the first line you’re telling Apache what URL to expose your WebDAV directory on. For example, if you are accessing the server via localhost, the above configuration would make your WebDAV URL equal to:

http://localhost/webdav/

With the Directory block you are actually configuring WebDAV access to the particular file location.

Line 9 is where this code block starts to differ from the configuration used by Manas. Unlike OmniFocus, VoodooPad works just fine with the more secure Digest authentication scheme, thus ensuring that your password isn’t sent over the wire in clear text.

Here we also, on line 13, tell Apache to only allow access by authenticated users. (The Manas configuration allowed read access by unauthenticated guest users.)

Step 4: Create the necessary directories.

sudo mkdir -p /Library/WebServer/WebDAV
sudo mkdir -p /usr/var

Step 5: Create user accounts and passwords

Now we use the htdigest tool to create your password file.

sudo htdigest -c /usr/var/webdav.passwd WebDAV-Realm "[username]"
New password:
Re-type new password:
Adding password for user [username]

Note that the “-c” specifies to create a new file. If you want to add additional users, get rid of the “-c” after the first time you issue htdigest.

Step 6: Setup permissions correctly.

sudo chown -R www:www /Library/WebServer/WebDAV
sudo chown -R www:www /usr/var
sudo chgrp www /usr/var/webdav.passwd

Step 7: Restart Apache gracefully.

sudo apachectl graceful

Step 8: Test WebDav

One convenient way to test your configuration is to attempt to mount your new WebDAV resource via Finder. To do this, open Finder and select Go > Connect to Server (⌘ K). Type your WebDAV URL, or http://localhost/webdav/ if you are on the server locally. Note that the trailing slash (“/”) is important, and you will not be able to connect without it.

You will be prompted by Finder to type in your username and password, and you need to be careful to enter these exactly as specified for the htdigest command.

Upon success, you will have mounted your WebDAV folder within Finder, and you should be able to copy a file to the folder.


Setting up VoodooPad using your new WebDAV server

For my needs, I’m planning to do all of my syncing on my local network. If you want to expose your WebDAV folder on the Internet, however, you will likely need additional configuration, such as setting up a dynamic DNS service, like DynDNS, and setting up your router/firewall to pass http traffic to your server.

Once any networking issues are resolved, configuring VoodooPad to use your new WebDAV server is pretty straightforward. On your primary machine, open the VP document that you want to sync, and then pull up the synchronization dialog from File > Synchronization Setup, enter your WebDAV URL, username and password. Your document is now being synchronized with the WebDAV server.

VoodooPad Configuration

Since sync in VP is set up on a document by document basis, on your second machine you will need to create and save a new document. (I gave it the same name on both machines.) Then, when you set up sync for the second document, use the “Pair with document” option on the sync dialog to identify the corresponding document on your WebDAV server.

I was a bit worried that it might cause problems to sync the new document with the sample text to the real document in WebDAV but it all worked out just fine.