Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed /opt/next back to original /opt

...

Code Block
sudo mkdir /opt/next
sudo /usr/java/jdk1.5/bin/java -jar WOInstaller.jar 5.4.3 /opt/next

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

Code Block
[root@ ~]# ls -l /opt/next
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

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

Code Block
NEXT_ROOT=/opt/next; export NEXT_ROOT

and run it manually in your current shell :

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

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 :

...

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

...

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

...

Code Block
Alias /WebObjects "/opt/next/Local/Library/WebServer/Documents/WebObjects"

...

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

...

Code Block
#!/bin/bash

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

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

NEXT_ROOT="/opt/next"
export NEXT_ROOT

PATH="/bin:/usr/bin:/usr/java/jdk1.5/bin"
export PATH

USER=appserver

# See how we were called.
case "$1" in
	start)
		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
		;;
	stop)
		echo -n "Shutting down wotaskd and Monitor: "
		WOTASKD_PID=`ps aux | awk '/WOPort 1085/ && !/awk/ {print $2}'`
		kill $WOTASKD_PID
		MONITOR_PID=`ps aux | awk '/WOPort 56789/ && !/awk/ {print $2}'`
		kill $MONITOR_PID
		echo
		;;
	restart)
		$0 stop
		$0 start
		;;
	*)
		echo -n "Usage: $0 {start|stop|restart}"
		exit 1
esac

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

exit 0

...

Code Block
description     "Start webobjects services"
author          "David LeBer"

start on runlevel [2345]
stop on runlevel [!2345]

env USER=appserver
env NEXT_ROOT=/opt/next
env WOTASKD_LOG=/var/log/webobjects/wotaskd.log

respawn
respawn limit 15 5

script
        echo "Launching wotaskd"
        su $USER -c "$NEXT_ROOT/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd -WOPort 1085 >> $WOTASKD_LOG 2>&1"
        emit wotaskd_running
end script

...