This adaptor has been tested on Mac OS X (with Apache version 1.3.14) and Solaris (with Apache version 1.3.9). It was not tested on other Apache 1.3.x versions besides the aforementioned, but it should work. Note that the adaptor is not backward-compatible with Apache 1.2.x versions, because the module API changed from version 1.2 to 1.3.
For convenience, this adaptor is configured to run out of the box on Mac OS X; no further installation or configuration is necessary. Any request with .../cgi-bin/WebObjects/...
will be handled by the WebObjects Apache module. The Apache module overrides the use of the WebObjects
executable in /Library/WebServer/CGI-Executables
, though you can optionally disable the Apache module so that the CGI adaptor handles such requests.
On Mac OS X, recompiling is just a matter of running make
in the /Developer/Examples/WebObjects/Source/Adaptors
directory.
The Apache WebObjects module has been tested on Solaris, as well. It has not been tested on HP-UX nor Windows NT/2000, but there's no known reason it shouldn't work. The apxs
rule in the Makefile works fine on Mac OS X and Solaris, but your experience may be different on other platforms. If your Apache web server can already accept Dynamic Shared Objects (DSOs), you can skip to the instructions for configuring the server to use the prebuilt Apache WebObject module.
General information regarding building Apache and including new DSO modules can be found at The Apache Group and in the documentation included with the web server and source for Apache v.1.3 or later.
This guide does not attempt to teach you how to build an Apache web server that can accept Dynamic Shared Objects such as the Apache WebObject adaptor. Please refer to the Apache web site for more details. Usually, you must at least configure the web server in the following manner:
./configure --enable-module=so
apxs
is located in /usr/sbin/apxs
on Mac OS X and in /usr/apache/bin/apxs
on Solaris (which usually means that the whole Apache package is installed in /usr/apache
on Solaris systems). If you install the Apache package elsewhere, you have to modify make.config
in ${NEXT_ROOT}/Developer/Examples/WebObjects/Source/Adaptors
.NEXT_ROOT
which contains the path to your WebObjects installation (e.g. /opt/Apple
).
PATH
environment variable, preferably as close to the beginning as possible.
${NEXT_ROOT}/Developer/Examples/WebObjects/Source/Adaptors/
directory; on Mac OS X, go to /Developer/Examples/WebObjects/Source/Adaptors/
. Amend make.config
so that the variable ADAPTORS
is only equal to Apache
. Run make
.
mod_WebObjects.so
in ${NEXT_ROOT}/Developer/Examples/WebObjects/Source/Adaptors/Apache
, you will not have to rebuild the Apache server. Configure the Apache web server.
Once you have built the adaptor and server, you'll need to configure the web server to handle WebObjects requests. On Mac OS X, the WebObjects installer has already properly set the configuration files, but you may still want to modify their parameters. On other platforms, you'll have to perform the following steps:
httpd.conf
. On Mac OS X, this file is located in the /etc/httpd
directory. Append these lines to the end of httpd.conf
:
# Including WebObjects Configs Include /System/Library/WebObjects/Adaptors/Apache/apache.confThis example "Include" line assumes that the
apache.conf
file supplied by WebObjects resides in the /System/Library/WebObjects/Adaptors/Apache
directory (on OS X). For other platforms other than OS X, it should be located in ${NEXT_ROOT}/Library/WebObjects/Adaptors/Apache
directory.
mod_WebObjects.so
to ${NEXT_ROOT}/Library/WebObjects/Adaptors/Apache
(on Mac OS X, /System/Library/WebObjects/Adaptors/Apache
). Ensure that the LoadModule
command in apache.conf
is pointing at the right path. Continuing the example from the previous step:
LoadModule WebObjects_module /System/Library/WebObjects/Adaptors/Apache/mod_WebObjects.so
apache.conf
:
WebObjectsDocumentRoot <the document root for the web server> WebObjectsAlias <the URL key> WebObjectsConfig <the URI to the configuration file> <interval between re-reading config>For example:
WebObjectsDocumentRoot /Local/Library/WebServer/Documents WebObjectsAlias /Apps/WebObjects WebObjectsConfig webobjects://239.128.14.2:1085 10The default alias is
/cgi-bin/WebObjects
. By default, the adaptor contacts the local instance of wotaskd to retrieve configuration information. Please consult the WebObjects document for more details. WebObjects supports three mechanisms for reading an adaptor configuration:
WebObjectsConfig file:///Local/Library/WebObjects/Configuration/WebObjects.xml WebObjectsConfig http://www.company.com/private/woappconfig.xml
WebObjectsConfig http://woserv1:1085,http://woserv2:1085,http://woserv2:1085 10
WebObjectsConfig webobjects://239.128.14.2:1085 10
<Location>
directive to the built web server's httpd.conf
file:
<Location /cgi-bin/WebObjects*> SetHandler WebObjects </Location>
Once you've built and configured the server with the linked adaptor, you should start it and confirm that it's working by moving aside the WebObjects
CGI adaptor in the cgi-bin
directory and making a few requests. If you still are suspicious that the CGI adaptor may be handling the requests instead of the DSO module, you can check this by turning on the logging feature of the adaptor as follows:
root
, touch /tmp/logWebObjects
tail -f /tmp/WebObjects.log
Info: <CGI> new request: /cgi-bin/WebObjects/MyApp
Info: <WebObjects Apache Module> new request: /cgi-bin/WebObjects/MyApp