[CalendarServer-users] CalendarServer on Fedora 13 & 14 Linux

Stewart Adam maillist at diffingo.com
Wed Nov 24 11:02:33 PST 2010


A while back I had asked a few questions about getting DCS setup on Fedora 13...
As my thanks I wanted to write back with how to get DCS setup from scratch on
Fedora 13/14. These instructions are also available here with better formatting:

Special notes before starting:
* DCS will be installed to /opt/CalendarServer to prevent conflicts with system
   libraries (i.e., twisted)
* DCS data roots will be in /srv/CalendarServer
* You must enable xattr on the partition containing the server data roots,
   for example by running "mount -o remount,user_xattr /" or by adding
   "user_xattr" to the mount options in the fstab.
* Unless a command sequence starts with "su -", it's intended to be executed as
   a regular user.

1. Install prerequisites:
   su -
   yum install subversion
   yum install patch memcached krb5-devel PyXML gcc gcc-c++ \

2. Checkout code and run setup
   mkdir CalendarServer&&  cd CalendarServer
   svn checkout http://svn.calendarserver.org/repository/calendarserver/CalendarServer/tags/release/CalendarServer-2.4 CalendarServer-2.4
   cd CalendarServer-2.4
   ./run -s

I'm not sure if this happens all the time, in my case downloading PyDirector
hanged. If the same happens to you, hit<ctrl+c>  to halt the install script and
   pushd ..
   wget http://downloads.sourceforge.net/pythondirector/pydirector-1.0.0.tar.gz
   tar xfz pydirector-1.0.0.tar.gz
   ./run -s

3. Prepare for installation
   su -
   mkdir -p /srv/CalendarServer/{Data,Documents}
   chown -R daemon:daemon /srv/CalendarServer/
   mkdir -p /opt/CalendarServer/etc/caldavd
   mkdir -p /opt/CalendarServer/var/run/caldavd
   mkdir -p /opt/CalendarServer/var/log/caldavd

4. Install DCS&  configure server (replace /home/regularuser as needed)
   su -
   cd /home/regularuser/CalendarServer/CalendarServer-2.4
   ./run -i /opt/CalendarServer
   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
   chmod 600 /opt/CalendarServer/etc/caldavd/*

5. Work around bugs #390 and #391
   su -
   sitelib="$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
   sitearch="$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib(1))')"
   if [ "$sitelib" != "$sitearch" ];then
     mv /opt/CalendarServer"${sitelib}"/twisted/plugins/caldav.py* /opt/CalendarServer"${sitearch}"/twisted/plugins
     sed -i.orig 's|PYTHONPATH="'"${sitelib}"'|DESTDIR=/opt/CalendarServer\nPYTHONPATH="${DESTDIR}'"${sitelib}"':${DESTDIR}'"${sitearch}"':|' /opt/CalendarServer/usr/bin/caldavd
     sed -i.orig 's|PYTHONPATH="'"${sitelib}"'|DESTDIR=/opt/CalendarServer\nPYTHONPATH="${DESTDIR}'"${sitelib}"':|' /opt/CalendarServer/usr/bin/caldavd

6a. If you already have some SSL certificates for the server, install them to
/opt/CalendarServer/etc/tls. If not, then you can create a self-signed one:
   su -
   mkdir /opt/CalendarServer/etc/tls
   openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout www.example.com.key -out www.example.com.crt

6b. Configure the server (don't add the double quotes in the XML):
* Set ServerHostName according to your setup
* Set DataRoot to "/srv/CalendarServer/Data/"
* Set DocumentRoot to "/srv/CalendarServer/Documents/"
* In the DirectoryService section, set xmlFile to "/opt/CalendarServer/etc/caldavd/accounts.xml"
* Set SudoersFile to "/opt/CalendarServer/etc/caldavd/sudoers.plist"
* Delete the Wiki section (Wikiserver authentication)
* Set AccessLogFile to "/opt/CalendarServer/var/log/caldavd/access.log"
* Set ErrorLogFile to "/opt/CalendarServer/var/log/caldavd/error.log"
* Set GlobalStatsSocket to "/opt/CalendarServer/var/run/caldavd/caldavd-stats.sock"
* Set ServerStatsFile to "/opt/CalendarServer/var/log/caldavd/stats.plist"
* Set PIDFile to "/opt/CalendarServer/var/run/caldavd/caldavd.pid"
* Set SSLCertificate to "/opt/CalendarServer/etc/tls/www.example.com.crt"
* Set SSLPrivateKey to "/opt/CalendarServer/etc/tls/www.example.com.key"
* Set UserName and GroupName to "daemon"
* In the iSchedule protocol section, set Servers to "/opt/CalendarServer/etc/caldavd/servertoserver.xml"
* Set ControlSocket to "/opt/CalendarServer/var/run/caldavd/caldavd.sock"
* Set twistd to "/opt/CalendarServer/usr/bin/twistd"
* In the Python Director section:
  - Set pydir to "/opt/CalendarServer/usr/bin/pydir.py"
  - Set ConfigFile to "/opt/CalendarServer/etc/pydir.xml"
  - Set ControlSocket to "/opt/CalendarServer/var/run/caldavd/caldavd-pydir.sock"

7. Test startup:
   su -
   /opt/CalendarServer/usr/bin/caldavd -X \
     -T /opt/CalendarServer/usr/bin/twistd \
     -f /opt/CalendarServer/etc/caldavd/caldavd.plist

If all goes well, then you can daemonize the server by running the same command
without "-X". If you want to run DCS at system startup, add that command to
/etc/rc.d/rc.local or create a small initscript from the Fedora template:


More information about the calendarserver-users mailing list