Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An example mod_expires configuration might look like:

Code Block
xml
xml

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A60
  ExpiresByType image/bmp A3600
  ExpiresByType image/gif A3600
  ExpiresByType image/ief A3600
  ExpiresByType image/jpeg A3600
  ExpiresByType image/png A3600
</IfModule>

You will also need the corresponding type-extension mappings:

Code Block
xml
xml

<IfModule mod_mime.c>
  AddType image/bmp bmp
  AddType image/gif gif
  AddType image/ief ief
  AddType image/jpeg jpeg
  AddType image/jpeg jpg
  AddType image/jpeg jpe
  ...
</IfModule>

...

Aaron Rosenzweig has a very thorough article about using mod_rewrite with Apache.

mod_rewrite with mod_webobjects

...

So in http.conf, search for mod_rewrite and change it to:

No Format

LoadModule WebObjects_module    /System/Library/WebObjects/Adaptors/Apache/mod_WebObjects.so
LoadModule rewrite_module       libexec/httpd/mod_rewrite.so

, find again:

No Format

AddModule mod_WebObjects.c
AddModule mod_rewrite.c

...

Here's an example mod_rewrite we use on one of our apps:

Code Block
xml
xml

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^/$ /page/HomePage [R]
  RewriteCond %{QUERY_STRING} ^appNum=([-0-9]+)(.*)$
  RewriteRule ^/page/(.*)$ /cgi-bin/WebObjects/AppName.woa/%1/wa/viewPage?pageName=$1%2 [L,PT]
  RewriteRule ^/page/(.*)$ /cgi-bin/WebObjects/AppName.woa/wa/viewPage?pageName=$1 [L,PT,QSA]
</IfModule>

...

The new default configuration is:

Code Block
xml
xml

<Directory />
   Options FollowSymLinks
   AllowOverride None
   Order deny,allow
   Deny from all
</Directory>

...

Info
titleNote

The default ScriptAlias directive in the 10.5 and 10.6 httpd.conf files is:

No Format

ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"

This prevents /cgi-bin/WebObjects from matching, so no change to WebObjectsAlias or ScriptAlias is necessary.

...

Enjoy your shiny new WO adaptor. (smile)

  • Note: if you are getting the error

    No Format
    
    libtool: compile: unable to infer tagged configuration
    libtool: compile: specify a tag with `--tag'
    apxs:Error: Command failed with rc=65536
    

...