Installing Darwin Calendar Server Version 2 on Centos 5

 

This is a simple step by step procedure on how to get Darwin Calendar Server running on a Centos 5 system.


 

These steps were originally completed in a virtual system running Proxmox, inside which was running Centos 5 standard 5.2.1 as an openVZ. The same steps should however be good for any other linux type system, though your method of installing packages and packages required might be different.

NOTE: REV:4538 was used for checking out calendarServer Trunk.

CREATE Storage

In the openVZ environment the “user_xattr” option was not set on the root file system so it’s not possible to use that for storing the calendar datafiles.  To over come this limitation, a disk was created from a 1Gb file and then mounted with the “user_xattr” option. This might not be required if you have a filesystem with “user_xattr” option enabled on it. The advantage of this method is that backing up the 1Gb file gives me a backup of all the calendars maintaining all the extra attributes etc.

 

$ dd if=/dev/zero of=/calData.dsk bs=1024k count=1024
$ mke2fs /calData.dsk
Under proxmox you need to enable the loop back device for the virtual to use it.
$ vzctl set 119 –devnodes loop0:rw –save # on the proxmox side of the server
$ losetup /dev/loop0 /calData.dsk
$ mount -o user_xattr /dev/loop0 /var/calData/
$ mkdir /var/calData/root
$ mkdir /var/calData/data

 

Change the permissions of the directories so that calendar server will be able to read/write to them

 

$ chown daemon:daemon /var/calData/root
$ chown daemon:daemon /var/calData/data

Make sure you’re All up to date and have all the necessary extras via yum

You might already have some of these packages installed which is fine, yum will tell you can carry on with those you don’t have, it’ll also resolve any dependancies.

 

$ yum -y update
$ yum install -y zlib-devel subversion gcc openssl-devel libevent libevent-devel sqlite-devel krb5-server.i386 krb5-workstation.i386 mod_auth_kerb.i386

Build and Install python 2.5

Centos by default comes with python 2.4.  Darwin calendar requires 2.5. After installing yum will appear to be broken. However this can be easily addressed by editing the yum script to point to python2.4, just edit the first line of the script and add “2.4” to the end.

 

$ wget http://python.org/ftp/python/2.5/Python-2.5.tgz
$ tar xvfz Python-2.5.tgz
$ cd Python-2.5
$ ./configure –prefix=/usr –with-system-zlib
$ make
$ make install

install setuptools

 

$ wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz#md5=0e9bbe1466f3ee29588cc09d3211a010
$ tar xfvz setuptools-0.6c8.tar.gz
$ cd setuptools-0.6c8
$ python setup.py build
$ python setup.py install

Install python’s SQLite

$ wget http://oss.itsystementwicklung.de/download/pysqlite/2.5/2.5.5/pysqlite-2.5.5.tar.gz
$ cd pysqlite-2.5.5
$ python setup.py build
$ python setup.py install

Fetch Darwin calendarServer etc..

$ svn co -r 4538 http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk CalendarServer
$ svn co http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk CalDAVClientLibrary
$ svn co http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk PyKerneros
$ cd PyKerneros
$ export PATH=$PATH:/usr/kerberos/bin
$ python setup.py build
$ python setup.py install

Build the calendar Server, this should now pull and compile any other parts required.

$ cd CalendarServer
$ ./run -s

Install

$ ./run -v -i / # installs caldavd into / directory and below

 

To resolve a pathing issue, you need to create the /usr/share/caldavd directly and create a link.

 

$ mkdir -p /usr/share/caldavd
$ ln -s /usr/bin /usr/share/caldavd/bin

 

Linking the two possible locations for configuration files makes sure you are always looking and writing to the correct configuration files.

 

$ ln -s /usr/caldavd /etc/caldavd

 

copy accounts.xml, sudoers.plist from CalendarServer/conf and CalendarServer/conf/auth into /etc/caldavd and edit either manually or with the ClientLibrary stuff.
edit /etc/caldavd/caldavd.plist to your environment. specifically allow plaintext authentication and disabling digest worked for me. You’ll likely also want to create and install an SSL Certificate.

Start it running

This will start Calendar server without demonising it. This will allow you to see all the logs scrolling past.  Once you’re happy that it’s working just right you can remove the “-X” and it’ll run as a daemon process.

 

$ /usr/bin/caldavd -X -f /etc/caldavd/caldavd.plist

If you see errors

  • Check for missing dependencies.
  • Check caldavd is pointing to the write location for calendar root and calendar data.
  • Make sure the calendar root and calendar data directories are on a filesystem with “user_xattr” enabled.
  • Using SSL, make sure Cert is valid, in the right places. Check cert does not have a password on it.
  • Check you have memcached installed.

may not be needed as memcached is included

make sure memcache has been installed along with libevent and ldconfig point to /usr/local/lib

 

$ wget http://www.danga.com/memcached/dist/memcached-1.4.0.tar.gz
$ tar zxpfv memcached*
$ cd memcached*
$ ./configure
$ make install