So you want to run an iCal server?

—by Joel Rennich, mactroll@afp548.com

9 October 2002

Captivated by the extreme coolness of Apple’s WebObjects iCal calendar display from .Mac? With a few minutes of work you can easily replicate this on your own.

First off you’ll need to grab phpicalendar, a wonderful PHP interpreter for iCal files. You can find out more about the software from their site on SourceForge.

curl -O http://telia.dl.sourceforge.net/sourceforge/phpicalendar/phpicalendar-0.6.tgz 
gnutar -xzvf phpicalendar-0.6.tgz 
sudo chown -R :www phpicalendar-0.6 
sudo chmod 777 phpicalendar-0.6/calendars 
cd phpicalendar-0.6

Move this folder to wherever you want it to appear in your Web site. For instance, you could move it into your Web site’s main folder and rename the phpicalendar-0.6 folder to calendar. In this setup, going to http://www.yoursite.com/calendar would get your Web interface for the iCal files.

After putting the code in the appropriate place, go into Server Settings and open up your site’s settings. Make sure that WebDAV is enabled both globally on your server and specifically for your site. Next, under the Access tab for your site, select the path to the phpicalendar folder and set up permissions to allow at least one user to author. This will allow you to publish the calendar from iCal.

Finally, if you haven’t already altered /etc/httpd/httpd.conf to allow the PHP module do that now. This is most easily done by going to the command line and using vi or emacs as root to edit the file. However you do it there will be two lines that reference PHP that need to have the # in front of them removed. In Mac OS X Server 10.2 this file is heavily commented by Apple so these two lines will be easy to see. The comments will reference needing them for the Webmail solution on Mac OS X Server which is also a PHP webpage.

All you have left to do now is to stop and start the Web server through Server Settings.

By using a browser to navigate to http://www.yoursite.com/calendar, you should see a nice Web interface that will allow you to browse the default home calendar that is supplied with the source code. That’s cool, but you want your own, right?

Fire up iCal and create a calendar, or just use one that you already have. Select the calendar. Under the Calendar menu, select Publish. In the window that pops up, select “Publish on a web server.” Now fill out the URL as “http://www.yourserver.com/calendar/calendars” with your username and password if you specified one when you set up the realm. Now click on publish. This will cause iCal to transfer a copy of your calendar up to your server over WebDAV into the appropriate place for phpicalendar to read it.

Go back to your Web browser and return to your calendar page. On the left hand side of the screen should be a pull-down menu that says “Home Calendar.” Select that and pull down and you should see your newly minted Web calendar. If it doesn’t show up try closing the browser window and then returning to the site.

Now do a happy dance and visit http://phpicalendar.sourceforge.net/phpBB2/ to tell the wonderful folks at phpicalendar that they are doing a wonderful job and ask what you can do to help out.