Marko's getting his blog on ;-)

Welcome to Mark's Blog
Friday, January 27 2012 @ 10:25 PM EST

Ubuntu CalDav Server for iCal, Thunderbird and Lighting

Tect StuffInstalling Apple's Darwin Calendar Server is fairly trivial... Here are the step in one document.Install procedure for Ubuntu

Installing Apple's Darwin Calendar Server is fairly trivial... Here are the step in one document.

Ready?

Log into the server console or via ssh, so you can enter commands(!) and run to get root access:

su -l

Install some software:

apt-get install subversion libkrb5-dev attr curl build-essential libssl-dev python-pysqlite2 bzip2 zope3 python-xml python-pyopenssl python-dateutil python-xattr python-pysqlite2 python-twisted python-vobject python-kerberos python-dev 

We now need to edit our /etc/fstab file and add user_xattr to the options for the partition containing the CalDAV server, / in this case:

vi /etc/fstab 

This is what the /etc/fstab change looks like:

Before: UUID=1234567-1234-4321-9876-12345678 / ext3 defaults,errors=remount-ro 0 1
After : UUID=1234567-1234-4321-9876-12345678 / ext3 defaults,errors=remount-ro,user_xattr 0 1

Remount the file system (to activate user_xattr):

mount -o remount / 

Create a directory for our server to live in:

mkdir /opt/caldavd
cd /opt/caldavd

Let's download the server software itself using subversion:

svn checkout http://svn.macosforge.org/repository/calendarserver/CalendarServer/tags/release/CalendarServer-1.2 CalendarServer

Subversion has downloaded a lot of software, and created a directory for us, called CalendarServer. Let's change into it:

cd CalendarServer

Run a script to download some necessary packages, configure, etc:

./run -s

Almost ready for action.... Let's copy the configuration:

cp conf/caldavd-test.plist conf/caldavd-dev.plist 

We do need to do a little configuration though:

vi conf/caldavd-dev.plist

First change the hostname for the server. Locate the line:

 <!-- Network host name --> 

and change  <string>localhost</string>  to  <string>your-real-hostname</string> 

To make the server available to connections from other computers. Locate this line:

<!-- List of IP addresses to bind to [empty = all] --> and replace  127.0.0.1  in  <string>127.0.0.1</string>  with either nothing or a specific, public ip address for your server.

Create a user and group to give our server an identity of its own, but we don't need a home directory for it:

adduser --system --group caldavd --no-create-home

Set permissions:

chown -R caldavd:caldavd /opt/caldavd

Run the server:

sudo -u caldavd -b /opt/caldavd/CalendarServer/run

That's it! The server is up and running, and you can connect to it with your CalDAV client using  caldav://ADDRESS:8008/calendars/users/admin/calendar to test the server using username  admin  and password  admin 

To work with Apple iCal under Mac OS 10.5, the URI required was simply:  caldav://ADDRESS:8008 

Here is an example init script: /etc/init.d/caldavd

#! /bin/sh

. /lib/lsb/init-functions

CALDAVD="/opt/caldavd/CalendarServer/run"
CALDAVD_USER="caldavd"
CALDAVD_OPTS="-d"
PIDFILE="/opt/caldavd/CalendarServer/logs/caldavd.pid"
NAME=caldavd

test -x $CALDAVD || exit 0

case "$1" in
  start)
        log_daemon_msg "Starting Darwin Calendar Server" "$NAME"
        if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --chuid $CALDAVD_USER --exec $CALDAVD -- $CALDAVD_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
  stop)
        log_daemon_msg "Stopping Darwin Calendar Server" "$NAME"
        if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
  restart)
        log_daemon_msg "Restarting Darwin Calendar Server" "$NAME"
        start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
        if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --chuid $CALDAVD_USER --exec $CALDAVD -- $CALDAVD_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
  status)
        status_of_proc -p "$CALDAVD" "$NAME" && exit 0 || exit $?
        ;;
  *)
        log_action_msg "Usage: /etc/init.d/caldavd {start|stop|restart|status}"
        exit 1
esac

exit 0

And to get it to load on boot and shutdown safely:

update-rc.d caldavd defaults

Done..!

Have a look in the /opt/caldavd/CalendarServer/conf directory, there you will find all the config files for users, calendars, etc.

The information on this page is a little "re-work" of the wiki.ubuntu.com/CalendarServer page.

Trackback

Trackback URL for this entry: http://mark.mckillen.com/trackback.php?id=20090220074155616

Here's what others have to say about 'Ubuntu CalDav Server for iCal, Thunderbird and Lighting':

Krulli&#039;s B.log &raquo; CalDav, DaviCal, going nuts&#8230; &laquo;
[...] Daher kann ich nicht weitermachen, da ich DaviCal nicht über den Browser erreichen kann… 2. Ubuntu CalDav Server for iCalDa hängt ich gleich beim ersten Schritt -.- “Install some software”… Ja, würde [...] [read more]
Tracked on Tuesday, May 04 2010 @ 09:10 AM EDT

CalDAV Server &raquo; Philipp Klaus&#039;s Blog
[...] Screen Saver CalDAV Server Computing Add comments Jul 302010 Apple Calendar Serverhttp://mark.mckillen.com/article.php?story=20090220074155616 [...] [read more]
Tracked on Saturday, January 22 2011 @ 12:36 PM EST

Ubuntu CalDav Server for iCal, Thunderbird and Lighting | 544 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Ubuntu CalDav Server for iCal, Thunderbird and Lighting
Authored by: Anonymous on Sunday, August 16 2009 @ 07:16 PM EDT

Hey Mark,

Thank you so much for posting this. I'll testing it out this week. I'll follow-up after it is implemented.

-daniel-
  • uMLMtNOzSjGWzm - Authored by: Anonymous on Tuesday, September 14 2010 @ 07:55 AM EDT
  • LbsuBzhvJMhYWckop - Authored by: Anonymous on Monday, February 28 2011 @ 10:23 PM EST
  • ufNLgbibZLjhjKoq - Authored by: Anonymous on Saturday, March 26 2011 @ 07:03 PM EDT
  • lfDFWQJmBPNJnEAdD - Authored by: Anonymous on Wednesday, April 06 2011 @ 07:19 AM EDT
  • vOTQmAgOpc - Authored by: Anonymous on Tuesday, April 12 2011 @ 08:36 AM EDT
  • KrcYTmpFHR - Authored by: Anonymous on Wednesday, April 27 2011 @ 01:41 AM EDT
  • agzeTIjZhwPx - Authored by: Anonymous on Thursday, July 07 2011 @ 06:17 PM EDT
  • nsgbgds - Authored by: Anonymous on Monday, August 08 2011 @ 10:51 PM EDT
  • uespbiNDpFQVLri - Authored by: Anonymous on Sunday, August 21 2011 @ 04:06 PM EDT
  • xohaisjToOVCbaySw - Authored by: Anonymous on Friday, October 28 2011 @ 10:30 PM EDT
  • TYtshvCxNf - Authored by: Anonymous on Thursday, December 22 2011 @ 06:20 PM EST
  • igKRRqjwWN - Authored by: Anonymous on Thursday, January 05 2012 @ 04:07 PM EST
  • WivWAmAsULHect - Authored by: Anonymous on Monday, January 16 2012 @ 08:56 AM EST
Ubuntu CalDav Server for iCal, Thunderbird and Lighting
Authored by: Anonymous on Monday, August 17 2009 @ 12:44 AM EDT

Hi Mark,

I just finished the install on a fresh Ubuntu 9.04 server. Everything looked good. But when I run:

/etc/init.d/caldavd start

I get the following errors:

* Starting Darwin Calendar Server caldavd
Downloading PyDirector...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 311 100 311 0 0 2140 0 --:--:-- --:--:-- --:--:-- 0

gzip: stdin: not in gzip format
tar: This does not look like a tar archive
tar: Error exit delayed from previous errors
[fail]

I'm not asking you to **fix** this or anything. I'm happy to research it on my own. For all I know, It's something I botched on my end. I just wanted to let you know what I found in case you were curious.

sincerely,

-daniel-
  • gBJPhYxLMaIdXrEFw - Authored by: Anonymous on Wednesday, September 01 2010 @ 10:30 AM EDT
  • JsvFQrfLqoYvg - Authored by: Anonymous on Tuesday, September 21 2010 @ 06:16 PM EDT
  • CHtQINQBWkuOAqT - Authored by: Anonymous on Friday, December 30 2011 @ 11:17 PM EST
  • xgfxjt - Authored by: Anonymous on Monday, January 09 2012 @ 12:46 AM EST
  • efiefthtcuv - Authored by: Anonymous on Sunday, November 28 2010 @ 05:51 PM EST
  • ysswkjwxctbwnmdpg - Authored by: Anonymous on Friday, December 03 2010 @ 05:44 PM EST