Documentation > How-to Classification > Apache > How to install mod_dav


About this HowTo

Author: Laurent Dinclaux
Usefull links:

http://www.webdav.org/
http://www.webdav.org/mod_dav/
http://www.mozilla.org/projects/calendar/faq.html#share
http://phpicalendar.sourceforge.net/nuke/index.php

Tested on: SME 5.6, SME 6.0 SME Version 6.01 GPL, SME 6.5
Created: 31 Mar 2004
License: GPL
Summary: This HowTo enable you to install webDav and enable it for specific Ibays
Keywords: mod_dav, mozilla calendar, ical, icalendar, webdav, web dav
Certification: Contribs.org in progess here


1) DOWNLOAD MOD_DAV

Download mod_dav rpm from rpmfind.net in a fresh directory.

Note: At the time of writing latest version was available from this page

2) INSTALL MOD_DAV

Cd to the directory where you downloaded the rpms and do:

rpm -Uvh mod_dav-1.0.3-5.i386.rpm


Note: replace 1.0.3-5 with the rpm version you have downloaded (if different)

3) SETUP APACHE

Create custom-template fragments directory:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

Load mod_dav module:

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/20LoadModule80mod_dav

Loadmodule dav_module modules/libdav.so


Add mod_dav module:

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/30AddModule60mod_dav

Addmodule mod_dav.c


Dav lockfile:

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/35DavLock

<IfModule mod_dav.c>
    DAVLockDB /var/run/davLocks/DAVLock
</IfModule>

mkdir /var/run/davLocks
chown www:www /var/run/davLocks



Add mod_dav to Ibays:

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/95AddModDav2ibays

{
        use esmith::config;
        use esmith::db;

        local %accounts;
        tie %accounts, 'esmith::config', '/home/e-smith/accounts';

        foreach my $key (grep { db_get_type(\%accounts, $_) eq 'ibay' } keys %accounts) {

                local $dav = db_get_prop(\%accounts, $key, 'ModDav') || 'disabled';

                if ($dav eq 'enabled') {
                        $OUT .= "\n<Directory /home/e-smith/files/ibays/$key/html>\n";
                        $OUT .= "    DAV        On\n";
                        $OUT .= "</Directory>\n";
                }

        }
}

Expand template and restart Apache:

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/etc/e-smith/events/actions/restart-httpd-full


4) ENABLE/DISABLE DAV FOR ANY IBAY

mod_dav is disabled by default for all ibays

ENABLING MOD_DAV

/sbin/e-smith/db accounts setprop IbayName ModDav enabled
/sbin/e-smith/signal-event ibay-modify IbayName

DISABLING MOD_DAV

/sbin/e-smith/db accounts setprop IbayName ModDav disabled
/sbin/e-smith/signal-event ibay-modify IbayName



4) SHARING CALENDARS

Whith those settings, you just have to create an ibay using server-manager and enable mod_dav for it. With you client Icalendar app (Mozilla Calendar, iCal etc.), you can create and subscribe to calendars with no login and no password just using an URL such http://yourServerName/ibayName/yourCalendarFile.ics.

If you want a login/password policy, you'll have to create a directory structure (for exemple one directory per user) and create in each directory .htaccess and .htpasswd files. I have found that url: http://www.javascriptkit.com/howto/htaccess3.shtml to help you set it up.



Documentation > How-to Classification > Apache > How to install mod_dav

Add your comments about this How To