Adding a Second WebObjects Host to a Basic Config


This article explains how to add another computer as a WebObjects application host to an existing simple setup. By simple setup, I mean a setup where currently one computer is running the default WO setup of being the apache web server and also hosting WO apps.

Our new setup is something like this where we are adding "computer 2". this is from this page


Let's say our primary computer has a host name of xapp2.local and the new one we are adding is named xmain2.local.

Configure the new WO Application Host
Basically configure this new host. It should be on the same subnet as the primary WO host that is currently running Monitor.woa.

Configuration is similar to that outlined in another article here except Monitor should not be running.

Install your apps and java extensions paying attention to contents and ownership/permissions of
/Library/WebObjects/Extensions
/Library/WebObjects/Applications
/Library/Java/Extensions

Also, if you have a specific directory set up in Properties of all your apps for your log4j logs like I have, create it on the new machine and give ownership to appserver:admin and permissions as 770.

We do not need to worry about or configure Apache webserver on this machine since our primary (xapp2.local) is running apache and Monitor.woa.

After that, go into Monitor and add the new host in the Hosts tab.

Next, we need to get the adaptor to "see" the new host. There are 3 ways to configure the adaptors. We

Go to the adaptor directory on the webserver (primary machine)
$ cd /System/Library/WebObjects/Adaptors/Apache
$ ls -al
total 432
drwxr-xr-x 5 root wheel 170 Jan 17 18:24 .
drwxr-xr-x 4 root wheel 136 Jul 1 2006 ..
-rw-r--r-- 1 root wheel 2358 Jul 1 2006 apache.conf
-rw-r--r-- 1 root wheel 210080 Jul 1 2006 mod_WebObjects.so

If you wish, make a backup copy of apache.conf using 'cp' command.

Open apache.conf as root (sudo) using your favorite command line editor (pico, nano, vi, etc.)
Edit the file parameters using Apple's docs as a guide and edit your WebObjectsConfig line to something like this as I have done for my two hosts xapp2 and xmain2
<snip>
# Host List Configuration
# wotaskd is started automatically on supported platforms,
# so this is the default mode.
# The apache module gets its configuration from the wotaskds
# listed on the configuration line
# For multiple hosts:
WebObjectsConfig http://xapp2.local:1085,http://xmain2.local:1085 10
# For localhost:
# WebObjectsConfig http://localhost:1085 10
</snip>


Save the file and exit.

Restart Apache gracefully (gracefully = kind to users)
$ sudo apachectl graceful

Now in monitor go to an existing app and add another instance and your should be up and running. Click on the link to it in Monitor and see if you can start a session or get activity on the instance on the new host.

Posted: Wed - January 17, 2007 at 09:59 PM        


Published by