Setup a simple Calendar Server

November 28th, 2005

This is small how-to will show you how to setup a small calendar server on a Fedora machine using apache, webdav, mozilla sunbird and 10 minutes of free time.

Our goals:
- Share calendars between users
- Simplify Calendar backup process
- Use ical Standard

Requirements:
- A running installation of Fedora Core (FC4 in my case)
- Apache webserver up and running
- An active network connection orFedora CdRom for additional packages

###### Server Side Setup ######

First of all check if mod_dav_svn is installed (on fedora it should be by default):

[root@machine /]# rpm -q mod_dav_svn

If you get any version number, ModDav is installed (maybe you can try an update via yum). If not launch yum and install it:

[root@machine /]# yum install mod_dav_svn

Now open apache config file

[root@machine /]# vi /etc/httpd/conf/httpd.conf

and check the presence of the WebDav lockfile by searching these lines:


# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb

If not, add the lines above just afver the last tag.

In order prevent any httpd error message (like this) make sure that the line Include conf.d/*.conf is just after all the loaded modules.

Now create a directory inside the httpd document root to store calendar files (by default fc use /var/www, change the path in order to fit your installation):

mkdir /var/www/html/calendar

And now create a passwd directory:

mkdir -p /etc/httpd/passwd/

Now reload Apache:

service httpd restart

If you don’t get any error, open apache config file again:

vi /etc/httpd/conf/httpd.conf

and add the following lines just before the document root tag:


DAV On
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /etc/httpd/passwd/passwords
require user webdav

Now restart Apache Again

service httpd restart

We’ll create a new user and pass to authenticate to the webserver. The username we will create should be limited to WebDAV operations only, in order to minimise the risk of your server being compromised.

Now create a password file:
htpasswd -c /etc/httpd/passwd/passwords webdav

In this example the password will be stored in a file called /etc/httpd/passwd/passwords, and the username required will be “webdav”.

Now create a Calendar Sample File:

vi /var/www/html/calendar/sample.ics

copy and paste these lines in the file:


BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
BEGIN:VEVENT
CREATED:20051128T225803Z
LAST-MODIFIED:20051128T225902Z
DTSTAMP:20051128T225803Z
UID:uuid1133218742734
SUMMARY:Calendar task from http://blog.soolid.it
PRIORITY:0
STATUS:
CLASS:PUBLIC
DTSTART:20051128T000000
DTEND:20071128T000000
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR

save and exit.

Make sure that the file is owned by apache:
chown apache:apache /var/www/html/calendar/sample.ics
and chmod it 755
chmod 755 /var/www/html/calendar/sample.ics

Now Download and Install Mozilla Sunbird on your client machine(s) (or any other ical compatible client) and subscribe to remote calendar file by giving the exact location of the .ical file (es: http://myserverorip/calendar/sample.ics) using username and password provided during the installation.

Now you can subscribe/edit/ remote calendars.

You can add multiple calendars for your users.

Offcourse, if you want a calendar file in read only mode, just give the url without password to your users.

# # # # # # About this guide # # # # # #

To Do’s:

  • Read the tutorial twice before publish :)
  • Try a new clean installation to test

Reference
Some guides/howto/forum post that help me to write this guide>