How To Share Calendars with Thunderbird, Lightning and PHP iCalendar

This article explains how to share calendars using Thunderbird with Lightning extension and PHP iCalendar, also it supposes that you are running Ubuntu.

Installation

  1. Download phpicalendar from http://sourceforge.net/projects/phpicalendar/
  2. PHP iCalendar require a webserver running PHP 4.1.2 or later, so install Apache2 with PHP module
    $ sudo apt-get install apache2 libapache2-mod-php5
  3. Enable WebDAV module in Apache
     $ sudo a2enmod
    Module name? dav
  4. Last command should enable dav_fs module as well, check it out with:
    $ ls -la /etc/apache2/mods-enabled/dav*

PHP iCalendar Configuration

  1. Untar phpicalendar tarball under /var/www directory
  2. Copy and edit the included configuration sample file
    $ sudo cp config.inc-dist.php config.inc.php
    $ sudo chown www-data: config.inc.php
    $ sudo vi config.inc.php
    
  3. Test application with browser at http://localhost/phpicalendar/index.php

WebDAV Configuration

  1. Create a user and password that will access to the calendars
    $ sudo htpasswd -c /var/www/phpicalendar/.webdav_login username
    $ sudo chmod 640 .webdav_login
    $ sudo chown www-data .webdav_login
    
  2. Setup the calendars directory as a WebDAV folder edit /etc/apache2/mods-available/dav_fs.conf
DAVLockDB /var/lock/apache2/DAVLock
#DAVMinTimeout 600

<Location /phpicalendar/calendars/>
Dav On
AuthType Basic
AuthName username
AuthUserFile /var/www/phpicalendar/.webdav_login
<LimitExcept OPTIONS>
Require user username
</LimitExcept>
</Location>

Thunderbird and Lightning

Install the following packages using Synaptic from menu System->Administration->Synaptic Package Manager

  • thunderbird
  • lightning-extension

Create and Publish a Calendar

  1. Open Thunderbird and click on Calendar
  2. Right click in the calendars list and create a New Calendar
  3. Choose On the Network
  4. Click on Next
  5. Select format: iCalencard (ICS)
  6. Insert location: http://localhost/phpicalendar/calendars/TestCalendar.ics
  7. Click on Next
  8. Provide a Calendar name: TestCalendar
  9. Click on Next and Finish
  10. Right click on the calendar that we have just created and click on Publish Calendar...
  11. Insert URL: http://localhost/phpicalendar/calendars/TestCalendar.ics then Close

Thunderbird doesn't provide any feedback, so check on the server that the calendar has been created properly

$ ls -l /var/www/phpicalendar/calendars/


You should see a `TestCalendar.ics` file.

Using Calendars from others PCs

To connect others client PCs to the same calendar, create a new calendar in Thunderbird in the same way as before, but there is no need to publish the calendar this time.

 

Danilo