Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enabling mod_dav with Apache 1.3.19 and PHP Internet
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
./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 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 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 file for Apache in order to get things working using the following commands in the Terminal:
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/
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.
# 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 (
  • Currently 2.57 / 5
  You rated: 4 / 5 (7 votes cast)

Enabling mod_dav with Apache 1.3.19 and PHP | 3 comments | Create New Account
Click here to return to the 'Enabling mod_dav with Apache 1.3.19 and PHP' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
WebDAV and iCal
Authored by: jgmanning on Sep 10, '02 01:56:22PM

Will these instructions work with Jaguar? I'd like to publish calendars on my home network.

[ Reply to This | # ]
WebDAV and iCal
Authored by: vlipper on Sep 10, '02 07:00:44PM

Works like a charm!

Because I fiddled some time with the settings off http.conf here is my diff:

< #LoadModule dav_module libexec/httpd/
> LoadModule dav_module libexec/httpd/
< #AddModule mod_dav.c
> AddModule mod_dav.c
> # Settings for WebDAV
> #
> #
> DAVLockDB /Library/WebServer/DAVLock/DAVLock
> DAVMinTimeout 600
> DAVDepthInfinity On
< AllowOverride None
> AllowOverride AuthConfig
> AuthName "DAV Restricted"
> AuthType Basic
> AuthUserFile /Library/WebServer/users
> Require valid-user
> DAV on

(Hope anyone can read this diff)

I also read this tip:

Now, all I need is jCal (my upcoming Java iCal clone ;-))

Bye, Vlipper

[ Reply to This | # ]
WebDAV and iCal
Authored by: datasmid on Sep 11, '02 03:14:39PM

To publish your iCal Calendar with Apache, edit apache's configuration file in /etc/httpd
(you must be root, so I expect you know vi and the workings of this file in general)

# vi /etc/httpd/htttpd.conf

In the Shared Library section where modules are loaded add these 2 lines in the same ordering in their repective sections:

LoadModule dav_module libexec/httpd/
AddModule mod_dav.c

Then somewhere in the global section add:
DAVLockDB /Library/WebServer/davlocks/DAVLockDB

I used this section to have a webdav folder managed by Apache:

<Directory "/Library/WebServer/Documents/dav">
AuthName 'WebDAV'
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd
AuthGroupFile /dev/null
require valid-user

I want this folder protected (somewhat) by a password, to generate the password file
with MD5 passwords (not that old crypt!) please use the -m flag. the file is text.
Note that http is vulnarable to sniffing attacks, someone on your network can get at your password.

# htpasswd -m -c /etc/httpd/.htpasswd user
New password: not_safe
Re-type new password: not_safe
Adding password for user user

Then set up the folder with permissions...

cd /Library/WebServer/
mkdir davlocks
chown www:www davlocks
cd Documents
mkdir dav
chown www:www dav

iCal Publish Calendar to http://localhost/dav/iCal

Do not ftp stuff in the dav folder, webdav uses it's own locking, don't confuse it.

Good Luck


[ Reply to This | # ]