You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

I needed to install the WebObjects deployment environment on a CentOS 5.2 64 bit box, and by combining tidbits of information from the mailing lists and the wiki, I was able to have a working environment. This is how I did it :

Install Sun Java JDK

1. You need to install a Java SDK. DON'T use the Java stuff from GNU, use a JDK from Sun instead. In my case, I installed JDK 1.5.0_16 from a RPM I got from I also created two symbolink links :

ln -s /usr/java/jdk1.5.0_16 /usr/java/jdk1.5
ln -s /usr/java/jdk1.5/bin/java /usr/bin/java

and you need to change your path in your bash profile (_~/.bash_profile) to have this path :


Install WebObjects

2. Get the WebObjects installer from mDimension's Web site :

curl -C - -O



and install it like this :

sudo /usr/java/jdk1.5/bin/java -jar WOInstaller.jar 5.4.3 /opt

(You can also install 5.3.3 instead of 5.4.3)
WebObjects frameworks are now installed in /opt

[root@ ~]# ls -l /opt/
total 12
drwxr-xr-x 3 root root 4096 Nov  9 08:19 Developer
drwxr-xr-x 4 root root 4096 Nov  9 08:19 Library
drwxr-xr-x 3 root root 4096 Nov  9 08:20 Local

3. Now we need to change some permissions. To follow the conventions from Mac OS X, we will create two users to run wotaskd and Monitor under this user :

sudo groupadd appserveradm
sudo useradd -g appserveradm appserver

and fix some permissions :

chown -R appserver:appserveradm /opt/Local
chown -R appserver:appserveradm /opt/Library
chmod 750 /opt/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor
chmod 750 /opt/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/
chmod 750 /opt/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd

4. Now we can start wotask and Monitor

[root@ ~]# su - appserver

Edit the bash profile of the appserver, and add this line :

NEXT_ROOT=/opt; export NEXT_ROOT

and run it manually in your current shell :

[appserver@ ~]$ NEXT_ROOT=/opt; export NEXT_ROOT

You can start wotaskd and Monitor to make sure that they run without any problems :

[appserver@ ~]$ $NEXT_ROOT/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &
[appserver@ ~]$ $NEXT_ROOT/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &


5. Last step : compiling and installing the Apache module

For Ubuntu distributions :

sudo apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils apache2-threaded-dev ssl-cert

On that system the relevant command names are apache2ctl and apxs2, and the document root is /var/www (not /usr/local/apache/htdocs as in the example below).

(you will need httpd-devel and gcc)

For CentOS, RedHat or Fedora distributions :

yum install httpd
yum install mod_ssl
yum install httpd-devel
chkconfig httpd on
/etc/init.d/httpd start

.. default install location is then /etc/httpd

HTTP Adaptor

Get the source of the module (adaptor) from Wonder. You only need the Adaptors (and its subfolders) folder.


Edit make.config and change the value of ADAPTOR_OS to LINUX. (this can be found in Adaptors directory (JS))

If using modern Ubuntu releases, you'll find that srandom is missing, so as mentioned on the list (JL) :At line 46 in Adaptor/random.c, just remove the check for WIN32, and use the initialisation
code in that block. That is, change this:

#if defined(WIN32)
time_t now;

to this:

time_t now;
Go to the ApacheXX folder that match your Apache version. In my case, I'm using Apache 2.2 built from source and installed in /usr/local/apache.

In another case I ran 'make CC=gcc' in the Adaptors directory then moved to the Apache2.2 directory. (JS)

[root@ Adaptors]# make CC=gcc
[root@ Adaptors]# cd Apache2.2/
[root@ Apache2.2]# apxs -i -a -n WebObjects
[root@ Apache2.2]# cp -rp /opt/Local/Library/WebServer/Documents/WebObjects /usr/local/apache/htdocs
[root@ Apache2.2]# cp apache.conf /usr/local/apache/conf/extra/webobjects.conf

You can also find pre-built binaries of the module at

Apache Configuration

Instead of copying the WebObjects directory, you can use a alias to point to the folder inside NEXT_ROOT. In your Apache configuration, add something like :

Alias /WebObjects "/opt/Local/Library/WebServer/Documents/WebObjects"

and add a directive to allow fetching files in this directory:

<Directory "/opt/Local/Library/WebServer/Documents/WebObjects">
      AllowOverride All
      Order allow,deny
      Allow from all

Or (depending on your Apache configuration) you could use a symbolic link.

You also need, as explained by the adaptor's README file, to add this directive in httpd.conf :

<LocationMatch /apps/WebObjects/.*>
    Order allow,deny
    Allow from all

If you don't add it, you will get 403s (Forbidden) HTTP errors.

If you want to keep /cgi-bin/WebObjects as the base URL, you will need to remove a line in httpd.conf. Find the line that starts with ScriptAlias /cgi-bin and comment it out, or else Apache will try to find a WebObjects CGI in /cgi-bin instead of loading the adaptor from the Apache module.

And edit /usr/local/apache/conf/extra/webobjects.conf to comment the LoadModule WebObjects_module line. You can also change the WebObjectsAlias property, in my case I use /apps/WebObjects. Last step : add the following line in httpd.conf (near the end):

Include conf/extra/webobjects.conf

Check for any errors with apachectl configtest, and if everything's ok, you are good to go. You can install your first app, don't forget that your app must be accessible by the appserver user or the appserveradm group. If your app don't start or if Monitor complains about a path, it might be a permission problem.

Jerome Chan told me that you can check if the Apache module is loaded by doing this :

/usr/local/apache/bin/apachectl -M

Auto Start WOTaskd and WOMonitor

One last thing, you need a init script to start wotaskd and Monitor at boot time. This is the one I wrote :


# chkconfig: - 90 20
# description: Provides WebObjects services

# Source function library.
. /etc/rc.d/init.d/functions

export NEXT_ROOT

export PATH


# See how we were called.
case "$1" in
		echo -n "Starting wotaskd and Monitor: "
		su $USER -c "$NEXT_ROOT/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd -WOPort 1085 &"
		su $USER -c "$NEXT_ROOT/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &"
		echo -n "Shutting down wotaskd and Monitor: "
		WOTASKD_PID=`ps aux | awk '/WOPort 1085/ && !/awk/ {print $2}'`
		MONITOR_PID=`ps aux | awk '/WOPort 56789/ && !/awk/ {print $2}'`
		$0 stop
		$0 start
		echo -n "Usage: $0 {start|stop|restart}"
		exit 1

if [ $# -gt 1 ]; then
	$0 $*

exit 0

You also need to add the script with chkconfig so that everything start up after a reboot. If you named the above script as "webobjects", do :

For CentOS, RedHat or Fedora distributions :

sudo /sbin/chkconfig --add webobjects
sudo /sbin/chkconfig webobjects on

For Ubuntu :

sudo update-rc.d webobjects defaults


If SELinux is enabled on your system, wotaskd won't run because of SELinux policies. You need to run :

sudo setsebool -P httpd_can_network_connect=1

Additional Resources

Jonathon Rentzsch WOPlat Project 'WOInstaller + Wonder Web Server Adaptor + OS Support Files'

  • No labels