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
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).
    •    
  • Currently 2.57 / 5
  You rated: 5 / 5 (7 votes cast)
 
[8,058 views]  

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:

236c236
< #LoadModule dav_module libexec/httpd/libdav.so
---
> LoadModule dav_module libexec/httpd/libdav.so
278c278
< #AddModule mod_dav.c
---
> AddModule mod_dav.c
382a383,390
> # Settings for WebDAV
> #
> #
> DAVLockDB /Library/WebServer/DAVLock/DAVLock
> DAVMinTimeout 600
> DAVDepthInfinity On
>
>
402c410,415
< AllowOverride None
---
>
> AllowOverride AuthConfig
> AuthName "DAV Restricted"
> AuthType Basic
> AuthUserFile /Library/WebServer/users
> Require valid-user
408a422
> DAV on
410d423

(Hope anyone can read this diff)

I also read this tip: http://www.macslash.org/comments.pl?sid=02/09/10/122225&threshold=0&commentsort=0&mode=thread&cid=9

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/libdav.so
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">
DAV On
AuthName 'WebDAV'
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd
AuthGroupFile /dev/null
<LimitExcept GET HEAD OPTIONS>
require valid-user
</LimitExcept>
</Directory>

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

Datasmid





[ Reply to This | # ]