rentzsch.com: tales from the red shed

WOWebLog httpd.conf Changes

WOWebLog
I've come to realize I never documented the changes I made to my httpd.conf file for WOWebLog. I'll remedy that now.

First, I added
LoadModule WebObjects_module /System/Library/WebObjects/Adaptors/Apache/mod_WebObjects.so
before
LoadModule rewrite_module libexec/httpd/mod_rewrite.so
and
AddModule mod_WebObjects.c
before
AddModule mod_rewrite.c.

This is because I use mod_rewrite to hide the normal ugly WebObjects URLs for the site, and I've been told the URL rewriting module must load before the WebObjects module in order to work correctly.

The WebObjects module directives are usually included at the end of httpd.conf via an
Include /System/Library/WebObjects/Adaptors/Apache/apache.conf. Since we've moved them up, I commented out those lines that appear in that file. It's not a big deal if you don't -- you'll just get a warning about the WebObjects module being loaded twice.

The big stuff is the mod_rewrite rules:

RewriteEngine on
RewriteRule ^(/cgi-bin/WebObjects/.*) $1 [L,PT]
RewriteRule ^(/WebObjects.*) $1 [L,PT]
RewriteRule ^(/images/.*)$ $1 [L,PT,NS]
RewriteRule ^(/share/.*)$ $1 [L,PT,NS]
RewriteRule ^(/favicon.ico)$ $1 [L,PT,NS]
RewriteRule ^(/[^/]+/)(javadoc/)(.*)$ $1$3 [L,PT]
RewriteRule ^(/[^/]+/)(doxygen/)(.*)$ $1$3 [L,PT]
RewriteRule ^(.*)$ /cgi-bin/WebObjects/WOWebLog.woa/wa/displayPage?path=$1 [L,PT]

Saturday, February 15, 2003
12:00 AM