Darwin Calendar and Contact Server

Firewall Ports
Calendar Server:

  • 8008
  • 8443 (https)


  • 8800
  • 8843 (https)

Use a CentOS 6.x system - OpenSSL on 5.x was not supported:
PyOpenSSl requires a higher version of OpenSSL than the one that comes with CentOS (0.9.8e). upgrading doesn't seem like the worthwhile approach.

Calendar Server requires a filesystem that supports Extended File Attributes (xattr). The EXT3 filesystem on the CentOS 6 supported it, just need to enable it for the disk in /etc/fstab

/dev/sda1 /                       ext3    defaults,user_xattr        1 1

Then reboot for it to remount the drive with xattr enabled.
Create directories to hold the calendar data and documents:

mkdir -p /var/calData/documents
mkdir -p /var/calData/data
chown daemon:daemon /var/calData/documents
chown daemon:daemon /var/calData/data

Install some dependencies using yum:

yum install libevent libevent-devel openssl-devel krb5-server krb5-workstation readline-devel python-devel openldap-devel

DCS requires SQLite, a self-contained, serverless, zero-configuration, transactional SQL database engine, to manage some internal databases:

cd /extra/src
wget http://www.sqlite.org/sqlite-autoconf-3071200.tar.gz 
tar zxf sqlite-autoconf-3071200.tar.gz
cd sqlite-autoconf-3071200

Configure, build and install:

make install

Install an updated version of Python which Calendar Server requires:

cd /extra/src
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar zxf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr
make install
echo '/usr/lib/python2.7' >> /etc/ld.so.conf.d/python2.7.conf

Upgrading Python broke the installed yum program which requires Python 2.4. Edit /usr/bin/yum and change the first line to:


Download EasyInstall and run it to install the appropriate setuptools egg for your Python version:

cd /extra/src
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

Install PyKerneros:

cd /extra/src
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

Install PyOpenDirectory:

cd /extra/src
svn co http://svn.calendarserver.org/repository/calendarserver/PyOpenDirectory/trunk PyOpenDirectory
cd PyOpenDirectory
python setup.py build
python setup.py install

Begin installation of the Calendar Server as a regular, non-root user:

useradd -d /home/calendaruser -m -s /bin/bash calendaruser
passwd calendaruser
su calendaruser

No packaged tarballs are provided for the source code so use Subversion to download it:

mkdir ~/calendar
cd ~/calendar
svn co http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk CalendarServer
svn co http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk CalDAVClientLibrary

Build the Calendar Server:

cd ~/calendar/CalendarServer
./run -s

Test run the server:

cd ~/calendar/CalendarServer
su calendaruser

Install for production use, as the root user:

su -
# setup installation root
mkdir -p /opt/CalendarServer/etc/caldavd
mkdir -p /opt/CalendarServer/var/run/caldavd
mkdir -p /opt/CalendarServer/var/log/caldavd
cd /home/calendaruser/calendar/CalendarServer
./run -v -i /opt/CalendarServer

Copy sample configuration files:

rm -rf /opt/CalendarServer/usr/caldavd/caldavd.plist
cp conf/servertoserver-test.xml /opt/CalendarServer/etc/caldavd/servertoserver.xml
cp conf/auth/accounts.xml /opt/CalendarServer/etc/caldavd/accounts.xml
cp conf/caldavd-test.plist /opt/CalendarServer/etc/caldavd/caldavd.plist
cp conf/sudoers.plist /opt/CalendarServer/etc/caldavd/sudoers.plist

Change permissions; passwords are stored plaintext!

chmod 600 /opt/CalendarServer/etc/caldavd/*

Linking the configuration file directory into /etc/caldavd so it's easier to find:

ln -s  /opt/CalendarServer/etc/caldavd /etc/caldavd

Edit /etc/caldavd/caldavd.plist to make some initial configuration:

    <!-- Data root -->

    <!-- Document root -->

    <!-- XML File Directory Service -->


    <!-- Principals that can pose as other principals -->

      <!-- Wikiserver authentication (Mac OS X) -->


    <!-- Apache-style access log -->

    <!-- Server activity log -->

    <!-- Server process ID file -->

        Process management



      <!-- iSchedule protocol options -->

    <!-- For child-master IPC. [empty = use tcp] -->



Try starting it:

/opt/CalendarServer/usr/bin/caldavd -T /opt/CalendarServer/usr/bin/twistd -f /etc/caldavd/caldavd.plist -X

Automatic Startup
Try using daemontools to control the Calendar Server
If you haven't already, install daemontools.

Create a directory for the Calendar service:

mkdir -m 1755 /var/service/calendar
cd /var/service/calendar

Create the run script and make it executable:

echo '#!/bin/sh' > run
echo 'exec 2>&1' >> run
echo 'exec /opt/CalendarServer/usr/bin/caldavd -T /usr/bin/twistd -f /etc/caldavd/caldavd.plist -X' >> run
chmod 755 run

Our log script comes from John Simpson's:

mkdir -m 755 log
cd log
wget http://qmail.jms1.net/scripts/service-any-log-run
mv service-any-log-run run
chmod 755 run

Finally, add the service to daemontools by creating the symbolic link in /service

ln -s /var/service/calendar /service/calendar

Confirm that the service is running:

svstat /service/calendar /service/calendar/log

Misc - not needed?
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


Recent Updates

  • 2 months 1 week ago
  • 2 months 1 week ago
  • 2 months 2 weeks ago
    php 8.x
  • 2 months 2 weeks ago
  • 2 months 2 weeks ago
    Drop Centos 5/6 stuff