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.
For all platform except Windows, the CGI adaptor uses a memory-mapped state file and does not need to contact wotaskd for each request. For Windows NT/2000, by default, the CGI adaptor contacts the instance of wotaskd on the local host to locate applications. Since this is expensive for a CGI program (it must do it every time), for deployment you would normally want to use a different mechanism - either a static file on the webserver machines, or a static URL. To change this, set the WO_CONFIG_URL environment variable. Examples:
For the latter case you'll need to make sure your web server is configured to send text/xml as the MIME type for .xml files.
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):
REQUEST_METHOD=GET;export REQUEST_METHOD
SERVER_PROTOCOL=HTTP/1.0;export SERVER_PROTOCOL
QUERY_STRING=\?foo=bar;export QUERY_STRING
SCRIPT_NAME=/cgi-bin/WebObjects;export SCRIPT_NAME
PATH_INFO=/MyApps/MyCoolApp;export PATH_INFO
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.
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.