Manually starting a WebObjects application

For debugging or deployment reasons, you may want to start your WebObjects application by hand.

There are two ways of doing this from Terminal.app's command window. Both use the DefaultApp executable that's in the <NeXT_Root>/NextLibrary/WebObjects/Executables directory.


Starting a single instance of a WebObjects application

This feature is only available on the computer that hosts your Web server, and only if WebObjects has been installed on it. As an example, to manually start HelloWorld

This is the simplest way to start an application by hand, with the limitation that you can only have one application with this name running on the server host.


Starting multiple instances of a WebObjects application

This feature is available on any computer with WebObjects installed on it, including possibly the computer that hosts the Web server. It is done in two steps.

  1. On a computer called <myHost>, change directories to <NeXT_Root>/NextLibrary/WebObjects/Executables and start the application in a terminal window by entering
       ./DefaultApp -p 3000 -n 1 Examples/HelloWorld
    
    This will start instance1 of HelloWorld on port 3000 of <myHost>.

  2. Go to your server machine <myServerHost> and create or edit the WebObjects.conf file in your Web server's cgi-bin directory by entering the following line in the file
       Examples/HelloWorld:1@myHost 3000
    
    Save the file. This lets the WebObjects adaptor know that an application HelloWorld 1 is available on the computer named <myHost> at port 3000 for serving requests.

    Now try contacting your application with the same URL as before

       http://<myServerHost>/cgi-bin/WebObjects/Examples/HelloWorld 
    
    All requests for Examples/HelloWorld will be forwarded on <myHost> to this WebObjects application.

You can also force the Web server to use one particular application running on a host by typing in your browser
   http://<myServerHost>/cgi-bin/WebObjects/Examples/HelloWorld:1@myHost
Remember always to pick ports greater than 1024 as ports under 1024 are reserved on UNIX platforms.