The standard WebObjects deployment method using wotaskd has built-in support for Load Balancing between multiple servers or Proxying requests through to a different server.
Assume you have two servers:
- Server1 (www.server.com) will be the primary server and will be the gateway for all requests (the proxy).
- Server2 (www2.server.com) will be a secondary server that also runs WO application instances.
In the standard configuration requests are processed the following way.
Web Browser -> Apache on Server1 -> mod_WebObjects (the WO Adaptor) -> WOApplication (local or remote)
So the requests first go the apache, then apache passes it to mod_WebObjects (the WO Adaptor). The adaptor decides where to send the request next based on the information it has received from the wotaskd instances running on each server. wotaskd is configured via JavaMonitor and it tells the adaptor which servers are running this application and what the load balancing strategy is (typically Round Robin). If the next WO application instance to be used is running on the same server as Apache then the request to passed to the local app and processed directly. If the next app instance is running on a different server then the request to passed directly to the remote application instance on the port it is running on (like 2001) and the response is returned. Note that the request doesn't go through Apache again on the remote server - it is received directly by the WO application through its port.
These are the components needed on each server:
Server1 (primary and gateway / proxy). Serves 1/2 (or whatever you want) of WO requests and ALL WebServerResources (static content).
- Apache and mod_WebObjects
- (Optional) Apache & mod_WebObjects (possibly useful for debugging)