Documentation > How-to Classification > Apache > How to install mod_dav on SME 7.x


About this HowTo

Release: A1.01
Author: Peter Walter
Credits: Based on a previous HOWTO for 6.x by Laurent Dinclaux.

Updated 7/22/06 by Michael McCarn to prevent line-wrapping in 95AddModDav2ibays and to clarify the Enable & Disable processes

Useful links:

http://www.webdav.org/
http://www.webdav.org/mod_dav/
HomePage.html/How%20to%20install%20mod_dav

Created: 9 April 2006
License: GPL
Summary: This document describes how to enable webdav for specific ibays on SME 7.x
Keywords: mod_dav, webdav, web dav

This is an alpha release. These instructions currently create a public ibay readable and writeable by anyone. Use at your own risk. Over time, these instructions will be updated to include instructions for securing the ibay. Feel free to update the wiki if you figure it out before I do.


1) Setup Apache 2.x

Create a 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/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so


Dav lockfile:

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

DAVLockDB /var/run/davLocks/DAVLock

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



Add mod_dav to ibays:

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

{
    use esmith::AccountsDB;
    my $adb = esmith::AccountsDB->open_ro();
    $OUT = "";
    foreach my $ibay ($adb->ibays)
    {
        my %properties = $ibay->props;
        my $key = $ibay->key;

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

Expand the template and restart Apache:

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith restart



2) Create or Configure an Ibay

Create or configure the target ibay as folllows:

User access via file sharing or user ftp write=group, read=group
Public access via web or anonymous ftp entire internet, no password required
Execution of dynamic content disabled



3) Enable / Disable MOD_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

Note: Replace IbayName with the name of the target ibay you created (or configured) in step 2.


Documentation > How-to Classification > Apache > How to install mod_dav on SME 7.x

Add your comments about this How To