ELS Howto: Sunbird Shared Calendars


Synopsis

This document explains how to configure an Elemental Linux Server system to support WebDAV for the purpose of sharing Mozilla Sunbird and other iCalendar-based software.


Prerequisites

You will need to have httpd installed on the ELS machine as well as access to a client machine with Mozilla Sunbird installed. See the ELS Howto: Apache Web Server for help setting up httpd.


Installation

Other than Apache httpd, there is no additional software than needs to be installed. However, you'll need to create a directory to hold the shared calendars and give it the proper permissions.

  1. Create a directory under httpd's document root for WebDAV uploads.
  2. Create another directory under the upload directory specifically for calendars.
  3. Change the file ownership on the new directories to the user that httpd runs as.

Example

The following example shows how you might create a shared calendar directory if /home/httpd is the web server's document root.

mkdir /home/httpd/upload

mkdir /home/httpd/upload/calendars

chown -R daemon /home/httpd/upload

Configuration

The following procedure outlines how to set up WebDAV with Apache httpd for the purpose of uploading shared calendars. These instructions assume that a non-WebDAV configuration of httpd is already set up and working.

  1. Copy httpd-dav.conf from /opt/httpd/conf/extra to /etc/opt/httpd.
  2. Edit the copy of httpd-dav.conf in /etc/opt/httpd and make the following changes:
    1. Change location of the DavLockDB to a directory that is writable by the user httpd is running as.
    2. Remove (or comment out) the Alias directive.
    3. Change Directory entry to match the directory created for shared calendars.
    4. Add an 'Options Indexes' directive to allow a directory listing of calendars to be seen from a web browser. (Not strictly necessary, but aids in troubleshooting.)
    5. Change the AuthName to suit your preference.
    6. Change AuthUserFile to a filename under the httpd configuration directory.
    7. Change the required user to a person who will have write access to the calendar.
  3. Edit httpd.conf and make the following changes:
    1. Uncomment all of the modules that are in the 'Required modules:' list at the top of http-dav.conf.
    2. Uncomment the Include line and change the path to httpd-dav.conf under the comment '# Distributed authoring and versioning (WebDAV)'
  4. Create a user with htdigest using the realm (AuthName) and username (Require user) from http-dav.conf.
  5. Restart Apache.

Example

The following example shows how httpd-dav.conf might be configured to allow uploads into the /home/httpd/upload directory by a user named Joe of a realm called 'Upload'.

DavLockDB "/var/opt/httpd/DavLock"

<Directory "/home/http/upload">
    Dav On
    Options Indexes  # Allows directory listing
    AuthType Digest
    AuthName Upload
    AuthUserFile "/etc/opt/httpd/user.passwd"
    AuthDigestProvider file

    <RequireAny>
        Require method GET POST OPTIONS
        Require user joe
    </RequireAny>
</Directory>

These modules need to be uncommented in httpd.conf to enable WebDAV.

LoadModule alias_module modules/mod_alias.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule setenvif_module modules/mod_setenvif.so

Creating the user for WebDAV uploads requires this command.

htdigest -c /etc/opt/httpd/user.passwd upload joe

Testing

  1. Open Mozilla Sunbird on a client workstation.
  2. Click File > New Calendar.
  3. Select On the Network.
  4. Select iCalendar (ICS) and provide the URL to where you want to store the calendar on your web server (e.g. http://els.mynetwork.lan/upload/calendars/test.ics).
  5. Choose a name for the calendar and finish the wizard.

If you have follow all the steps above and things are not working out with the configuration test, try the following:

  1. Check the filesystem directory to see if the calendar.ics file was created.
  2. Verify that you can open the calendar URL in a web browser.
  3. Run netstat -tlnp | grep httpd to verify that httpd is listening on port 80
  4. Verify that firewall rules allow unrestricted access on port 80 for any hosts trying to access the calendar.
  5. Test network connectivity to the server by pinging it from another machine.