CGI adaptor interface for WebObjects


This is a generic CGI adaptor designed to be usable with all webservers that supports CGI. There is a performance disadvantage in using the CGI version; you are encouraged to use a server plugin adaptor whenever possible.

To install this adaptor, copy the file WebObjects (or WebObjects.exe on Windows) to your web server's cgi-bin or scripts directory. This is done for you if you install WebObjects on to the system with a web server installed.

Security Note

Please note that the WOAdaptorInfo (configuration information listing) and application listing functionality are enabled by default with the CGI adaptor for the convenience of developers. These should be disabled for deployment. To disable these features, you need to set the following environment variables to "disabled" so that the CGI program can determine the functions are switched off, or, alternatively, rebuild the CGI adaptor with a code change to turn off the feature (see WebObjects.c for how to do this).

Adaptor Configuration

The CGI adaptor configuration is modified by using environment variables. You must consult your WebServer documentation to understand how to create and pass environment settings on to a CGI program.

Debugging using the CGI adaptor

There is a good reason to use the CGI adaptor: to exercise the underlying request handler and debug any customizations you may have made to the source code. Since all input to any CGI program is provided in the environment variables and stdin, the WebObjects CGI program can be conveniently run under a debugger.

To do this, set the following environment variables (examples using /bin/sh):

If you want to include form data, set a CONTENT_LENGTH header and type the form as stdin.

Another solution is to edit the provided TestCGI.sh or Env.csh file to suit your needs and execute it.

Mac OS X Server Issues

If there are problems executing the CGI adaptor on MacOS X Server, make sure that the "WebObjects" CGI executable is located in /Library/WebServer/CGI-Executables/, is owned by root:admin, and is executable by everyone. If MacOS X Server is running on an HFS filesystem, stop the WebServer, remove the /tmp/WOAdaptorState file, "touch WebObjects", and restart the WebServer. You may have to repeat this process (i.e. "touch WebObjects" and restart) after every boot or reboot for the WebServer to notice it.