WebObjects/Web Applications/Deployment/FreeBSD WO5.3

Setup WebObjects 5.3.1 or 5.3.2 on FreeBSD 6.1 release (i386) Rev 0.8 2007-05-22 Francois BIENTZ (francois.bientz@voila.fr)

Document based on the How-to :Setup WebObjects on Linux (Stefan Apelt) : http://www.tetlabors.de/wo/setup_webobjects_on_linux.html. Other platforms http://www.tetlabors.de/wo/

Thanks to Stefan Apelt, Ari Maniatis and Piotr Intres (Gentoo install)

What you need :
 * FreeBSD 6.1 X86 box
 * a Mac and OSX 10.4.7 XCode 2.4, WebObjects dev installed.
 * or a Mac and OSX 10.4.7 server WebObjects 5.3.1 deploy installed.

Install Java and Apache
You can can build and install the native Java - using the ports system (see http://www.freebsd.org/java) - or download the diablo Java 1.5 package from the FreeBSD foundation:http://www.freebsdfoundation.org/downloads/java.shtml file: diablo-jdk-freebsd6.i386.1.5.0.07.00.tbz.

Install Apache : I used the apache+ssl-1.3.34.1.57 port

WebObjects 5.3.2 installation from OSX or WebObjects 5.3.1 from OSX server
On FreeBSD create these directories: /usr/local/apple/Library /usr/local/apple/Local/Library

Directories/Files to copy from OSX to FreeBSD:

FreeBSD: in /usr/local/apple/Library/Frameworks (OSX : /System/Library/Frameworks) /JavaDirectToWeb.framework /JavaDTWGeneration.framework /JavaEOAccess.framework /JavaEOApplication.framework /JavaEOCocoa.framework /JavaEOControl.framework /JavaEODistribution.framework /JavaEOGeneration.framework /JavaEOInterface.framework /JavaEOInterfaceCocoa.framework /JavaEOInterfaceSwing.framework /JavaEOProject.framework /JavaEORuleSystem.framework /JavaFoundation.framework /JavaJDBCAdaptor.framework /JavaJNDIAdaptor.framework /JavaWebObjects.framework /JavaWebServicesClient.framework /JavaWebServicesGeneration.framework /JavaWebServicesSupport.framework /JavaWOExtensions.framework /JavaWOJSPServlet.framework /JavaXML.framework

FreeBSD: in /usr/local/apple/Library/Java (OSX : /System/Library/Java) wojavaclient.jar

FreeBSD: in /usr/local/apple/Library/PrivateFrameworks (OSX : /System/Library/PrivateFrameworks) /EOPlaceholders.framework /JavaMonitor.framework

FreeBSD: in /usr/local/apple/Library/WebObjects (OSX : /System/Library/WebObjects) /JavaApplications /WODocumentRoot

FreeBSD: in /usr/local/apple/Local/Library/WebObjects/Extensions (OSX: /Library/WebObjects/Extensions) axis-ant.jar axis.jar commons-discovery.jar commons-logging.jar jaxrpc.jar log4j-1.2.8.jar saaj.jar wsdl4j.jar

Install the Apache adaptor for FreeBSD
edit /etc/profile and add : NEXT_ROOT=/usr/local/apple export NEXT_ROOT OS= FREEBSD export OS log off an log in (with a user login) then su


 * Download the binary for FreeBSD 6.1 or
 * Compile using Wo 5.2 Solaris

Copy mod_WebObjects.so into /usr/local/libexec/apache.

Configure Apache for WebObjects
Copy the configuration file for WebObjects to the Apache conf folder: cp webobjects.conf /usr/local/etc/apache/

The webobjects.conf file :
 * 1) WebObjects : Enable the WebObjects module.

LoadModule WebObjects_module /usr/local/libexec/apache/mod_WebObjects.so
 * 1) AddModule mod_WebObjects.c

WebObjectsDocumentRoot /usr/local/www/data
 * 1) Path to the Document Root of your Webserver,
 * 2) it should contain a directory named WebObjects

WebObjectsAlias /cgi-bin/WebObjects
 * 1) You can change the 'cgi-bin' part of WebObjectsAlias to whatever you
 * 2) prefer (such as Apps), but the 'WebObjects' part is required.


 * 1) Here are the 3 possible configuration modes.
 * 2) The apache module uses one of them to get information
 * 3) about your deployed applications.
 * 4) 1085 is the reserved port on which wotaskd processes listen to by default.

WebObjectsConfig http://localhost:1085 10
 * 1) Host List Configuration
 * 2) wotaskd is started automatically on supported platforms,
 * 3) so this is the default mode.
 * 4) The apache module gets its configuration from the wotaskds
 * 5) listed on the configuration line
 * 6) For multiple hosts:
 * 7) WebObjectsConfig http://:,http://:
 * 8) For localhost:


 * 1) Multicast Configuration
 * 2) The apache module gets its configuration from all wotaskds
 * 3) that respond to the multicast call on the subnet
 * 4) WebObjectsConfig webobjects://239.128.14.2:1085 10


 * 1) File Configuration
 * 2) The apache module gets its configuration from one file
 * 3) WebObjectsConfig file:// 10


 * 1) To enable public access to the WOAdaptorInfo page, uncomment the following line
 * 2) WebObjectsAdminUsername public


 * 1) To enable the WOAdaptorInfo page with restricted access,
 * 2) uncomment the next two lines and set the user and password
 * 3) To access the WOAdaptorInfo page with restricted access,
 * 4) use a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password.
 * 5) WebObjectsAdminUsername user
 * 6) WebObjectsAdminPassword password


 * 1) To change the logging options, read the following comments:
 * 2) The option name is "WebObjectsLog" and the first value indicates the path of the log file.
 * 3) The second value indicates the log level. There are five, in decreasing informational order:
 * 4) 	"Debug",    "Info",    "Warn",    "Error",    "User"
 * 5) Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user (usually root).
 * 6) The following line is the default:
 * 7) WebObjectsLog /tmp/WebObjects.log Debug
 * 1) The following line is the default:
 * 2) WebObjectsLog /tmp/WebObjects.log Debug

Edit /usr/local/etc/apache/httpsd.conf. Search for the line "LoadModule rewrite_module ..." and insert the following lines right _before_ it:

Include /usr/local/etc/apache/webobjects.conf  SetHandler WebObjects 

Search for the line "AddModule mod_rewrite.c" and put the following line right after that:

AddModule mod_WebObjects.c

Search for a line "ServerName ..." and put your DNS host name in there. If you do not have one, you can use your IP adress, too. The explanation within httpd.conf about this is very good.

ServerName yourhost.yourdomain.com

Save and exit. Now, to see if everything is right, try:

/usr/local/sbin/httpsdctl configtest

If it says "Syntax OK", you are fine. Else, try to find and correct the errors it reports.

Start Apache and WO Services
Start Apache: /usr/local/sbin/httpdsctl start

Start wotaskd : $NEXT_ROOT/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &

Start JavaMonitor and test the installation
The last step before adding application is starting JavaMonitor and see if it works: $NEXT_ROOT/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789

After JavaMonitor is launched, you will see a line similar to the following:

Your application's URL is: http://yourhost.yourdomain.com:56789/cgi-bin/WebObjects/JavaMonitor.woa

Open this URL in a web browser.

Create startup scripts for wotaskd and javamonitor
Install lsof from the ports

Create /usr/local/etc/rc.d/110.wotaskd.sh
 * 1) !/bin/sh

NEXTROOT=/usr/local/apple

case "$1" in       start)           export PATH=/usr/local/bin:$PATH           export NEXT_ROOT=${NEXTROOT}           ${NEXTROOT}/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &           echo -n ' wotaskd'           ;;        stop) lsof -i tcp:1085 |grep LISTEN | sort -u | awk '{print"kill -9 " $2}' | sh               ;; *)          echo ""           echo "Usage: `basename $0` { start | stop }"           echo ""           exit 64                ;; esac Then  chmod +x /usr/local/etc/rc.d/110.wotaskd.sh Create /usr/local/etc/rc.d/150.javamonitor.sh
 * 1) !/bin/sh

NEXTROOT=/usr/local/apple

case "$1" in       start)           export PATH=/usr/local/bin:$PATH           export NEXT_ROOT=${NEXTROOT}           ${NEXTROOT}/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &           echo -n 'JavaMonitor'                        ;;        stop) lsof -i tcp:56789 |grep LISTEN | sort -u |awk '{print"kill -9 "$2}' | sh           ;; *)          echo ""           echo "Usage: `basename $0` { start | stop }"           echo ""           exit 64            ;; esac Then  chmod +x /usr/local/etc/rc.d/150.javamonitor.sh

JDBC jars location.
for mySQL: put the mysql-connector-java-3.0.17-ga-bin.jar in /usr/local/apple/Local/Library/WebObjects/Extensions.