Enabling mod_dav with Apache 1.3.19 and PHP

Apr 08, '01 08:15:24PM

Contributed by: scottboms

This is really only relevant if you've followed the instructions from StepWise on how to configure and install Apache 1.3.19 and PHP 4.0.4pl1. What I discovered was that when you restart Apache, it will basically hang because of an error related to the apxs binary in /usr/sbin (take a look in the Console app for the exact error).

If you want to run your web server with WebDAV capabilities enabled on it, you will need to download the latest version of mod_dav, configure and install it, replacing the pre-installed module for Apache. The information for installing mod_dav can be found on the mod_dav site, but I will summarize it here.

Read the rest of the article for an excellent how-to on installing WebDAV support onto your new Apache...

Build and Install Steps:

1. Configuration:
There are two options for installing mod_dav into your Apache installation. The first is to create a dynamically linked module using the apxs tool. The second method statically links mod_dav into the Apache executable file.

Using the Terminal app, select whichever method you prefer and type one the following:

./configure  --with-apxs=/usr/sbin/apxs
or
./configure  --with-apache=/usr
The configuration will go ahead and will locate all the necessary libraries and auxilliary files. This includes the Expat Library (XML parser), which is also found in /usr/sbin. If for some reason it cannot locate that library, you will need to force it to locate it using the following commands:

./configure  --with-apxs=/usr/sbin/apxs  --with-expat=/usr/sbin/expat
2. Build and Install:
To finish the build and make the install, just use the following two commands at a Terminal prompt.
make
make install
If you chose to do a dynamically loading module, then mod_dav will be installed into Apache's runtime location. If this does not work and you receive an error, take a look at the expanded documentation on the www.webdav.org site which explains what it means and what you will need to do to fix the problem.

If you chose to link the mod_dav module statically, you will need to run the configure.style file for Apache in order to get things working using the following commands in the Terminal:
--activate-module=src/modules/dav/libdav.a
3. Configure Apache.
Go find your Apache httpd.conf file in the /private/etc/httpd/ directory and open it in the Text Edit app. The modules should already be activated for you, but you might want to take quick look anyway. Look for the following lines under the DSO section of the configuration file:
LoadModule dav_module libexec/httpd/libdav.so
AddModule mod_dav.c
Next, we need to create the Lock Database. To do this, in your Terminal, type the following:
mkdir -p /Library/WebServer/davlocks
chmod 777 /Library/WebServer/davlocks
mkdir -p /Library/WebServer/davlocks/DAVLockDB
Now we need to add two more lines to the httpd.conf file to make it look like what you see below. This is taken from my own Apache config file, and I've tested that it does in fact work. Enter the line below the directive that sets the location of your WebDAV DAVLockDB database, and then the line below the second directive that simply says DAV On.

Save your httpd.conf file and you're basically done. I've included a few extra lines of the file to give you a context for where the two lines go. I initially had problems with the other tutorials I'd seen floating around, but maybe it was just me ;-).
#
DocumentRoot "/Library/WebServer/Documents"
#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
Options FollowSymLinks
AllowOverride None
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
DAVLockDB /Library/WebServer/davlocks/DAVLockDB
#
# This should be changed to whatever you set DocumentRoot to.
#
DAV On
# etc...
4. Finish up:
Get yourself a WebDAV client app such as Goliath (which has been ported to OS X), load up some files into your web server Documents folder and have fun.

Note that Acrobat 5, Dreamweaver 4, UltraDev 4, GoLive 5, Photoshop 6 and some other apps all support WebDAV. There's more info on how to configure Goliath at the Goliath website (http://www.webdav.org/goliath).

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010408201524843