I’ve played with various approaches to shared calendars for the last few years – largely without much success. The lack of progress in this area has been strange and annoying as it’s really a service that many people need but most businesses need. The dominance of Exchange Server in this area may explain some of it, but I don’t think it can explain everything. I’ve watched the emergence of CalDAV with some interest but until recently hadn’t bitten the bullet and done anything about it – until this week.

The Mozilla Sunbird client works well and runs on Linux and Windows. It supports CalDAV and so running a CalDAv server shouldn’t be a problem so I figured this should move me away from the hacks I’ve tried before and get me to a point where things simply worked without constant intervention.

Having gotten this far, it was time to find a CalDAV server. Given how long the specification has been around I figured there would be a few to choose from. As usual, I wanted an open source solution and one that wasn’t Java (sorry Java weenies) and would run on Ubuntu. Naively, I didn’t think this would be too hard!

After a few web searches with a variety of keywords I was going round in circles. Every search gave me the Apple CalendarServer as the first or second result with a mixture of others – most of which I’d not heard of before. When I came across a post about running the apple server on Ubuntu and seeing someone I know from Apache was involved in the project, I decided to give it a go. There didnt seem to be a package available, so it was time to grab the source and build.

Getting the source proved easy enough, but building it revealed a lot of missing packages form the machine, each quickly solved. [* I had to edit some of the files as they included the Python.h header by using ‘Python/Python.h’ which didn’t work. using just ‘Python.h’ worked fine. *] Finally I had a built server. Running the quick test showed it to be working OK. Now I needed to install it.

Running the install command proved to be a disaster the first time round. For some reason the installer ignored all the usual conventions (well it is Apple I shouldn’t have been surprised) and stuck the required files into an odd folder. I removed the folder and debated what had gone wrong. Eventually I ran the installer again using ‘sudo ./run -i /’ and things seemed to end up in more sensible places. The location for the installed config file was /usr/caldavd. Hardly where I would have expected it, but possibly not a bad choice given that this is still highly experimental. in keeping with the experimental nature of this I decided to use that directory for the configuration, data and documents.

The next step was to configure the server. This is done by the caldavd.plist file, which is just a slightly odd xml file. Apparently the file is considered straightforward enough not to need any documentation – but I didn’t find it that way and struggled a bit to get things setup the way I wanted.

I added a user, caldavd, to run the service and below are the steps I took to get the various directories and the config file ready. This probably isn’t the ideal way of doing things and I’m sure once there is a debian package available things will move, but this layout does keep things together to allow easy removal for when that happens. Comments or suggestions for improvements welcome 🙂

  1. sudo mkdir /usr/caldavd/conf
  2. sudo mkdir /usr/caldavd/data
  3. sudo mkdir /usr/caldavd/documents
  4. sudo chown -R caldavd:caldavd /usr/caldavd
  5. sudo mkdir /var/log/caldavd
  6. sudo vi /usr/caldavd/caldavd.plist - Set DataDir to /usr/caldavd/data
  • Set DocumentDir to /usr/caldavd/documents
  • Set Directory Service xmlFile to /usr/caldavd/conf/accounts.xml
  • Set SudoersList to /usr/caldavd/conf/sudoers.plist
  • Set AccessLogFile to /var/log/caldavd/access.log
  • Set ErrorLogFile to /var/log/caldavd/error.log
  • Set ServerStatsFile to /var/log/caldavd/stats.plist
  • Set PIDFile to /var/run/caldavd.pid
  • Set UserName to caldavd
  • Set ControlSocket to /var/run/caldavd.sock
  • Set Twisted deamon path to /usr/bin/twistd
  • Set PythonDirector pydir path to /usr/bin/pydir.py
  1. sudo caldavd -f /usr/caldavd/caldavd.plist

At this point you should see warnings about a missing accounts.xml file. This file needs to be created in /usr/caldavd/conf/accounts.xml. The format is reasonably easy to follow.

david david xxxxxx David Reid mailto:xxxxxxxxx ... family family xxxx Family Calendar david ...

You’ll also need to add the sudoers.plist file (though I’m not sure what exactly this does to be honest and the documentation I read didn’t throw any light on it). The format of this file seems to be as follows.

users username superuser password superuser

The mailing lists for the server could do with a fully searchable archive, and if one exists then a link somewhere on the site to it would be helpful. They do represent a useful place to look, but the lack of documentation has really been frustrating. Thankfully there are several other useful blog posts around that have allowed me to get this far, so maybe this will help someone else.