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 ApacheEdit

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 serverEdit

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 FreeBSDEdit

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

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

Configure Apache for WebObjectsEdit

Copy the configuration file for WebObjects to the Apache conf folder:

cp webobjects.conf /usr/local/etc/apache/

The webobjects.conf file :

# WebObjects : Enable the WebObjects module.


LoadModule WebObjects_module /usr/local/libexec/apache/mod_WebObjects.so
#AddModule mod_WebObjects.c

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

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

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

# 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://<name-of-a-host>:<port-on-a-host>,http://<name-of-another-host>:<port-on-a-host> <interval>
# For localhost: 
WebObjectsConfig http://localhost:1085 10

# Multicast Configuration
# The apache module gets its configuration from all wotaskds
# that respond to the multicast call on the subnet
# WebObjectsConfig webobjects://239.128.14.2:1085 10

# File Configuration
# The apache module gets its configuration from one file
# WebObjectsConfig file://<path-to-a-xml-config-file> 10


# To enable public access to the WOAdaptorInfo page, uncomment the following line
# WebObjectsAdminUsername public

# To enable the WOAdaptorInfo page with restricted access,
# uncomment the next two lines and set the user and password
# To access the WOAdaptorInfo page with restricted access, 
# use a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password.
# WebObjectsAdminUsername user
# WebObjectsAdminPassword password

# To change the logging options, read the following comments:
# The option name is "WebObjectsLog" and the first value indicates the path of the log file.
# The second value indicates the log level. There are five, in decreasing informational order:
#       "Debug",    "Info",    "Warn",    "Error",    "User"
#
# Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user (usually root).
#
# The following line is the default:
# 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
<Location /cgi-bin/./>
SetHandler WebObjects
</Location>

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 ServicesEdit

Start Apache: /usr/local/sbin/httpdsctl start

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


Start JavaMonitor and test the installationEdit

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 similiar 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 javamonitorEdit

Install lsof from the ports

Create /usr/local/etc/rc.d/110.wotaskd.sh

#!/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

#!/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.Edit

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

Last modified on 17 July 2009, at 20:30