# 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:
Directories/Files to copy from OSX to FreeBSD:
FreeBSD: in /usr/local/apple/Library/Frameworks (OSX : /System/Library/Frameworks)
FreeBSD: in /usr/local/apple/Library/Java (OSX : /System/Library/Java)
FreeBSD: in /usr/local/apple/Library/PrivateFrameworks (OSX : /System/Library/PrivateFrameworks)
FreeBSD: in /usr/local/apple/Library/WebObjects (OSX : /System/Library/WebObjects)
FreeBSD: in /usr/local/apple/Local/Library/WebObjects/Extensions (OSX: /Library/WebObjects/Extensions)

## Install the Apache adaptor for FreeBSD

edit /etc/profile and add :
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:
The webobjects.conf file :
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:
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
Then
Create /usr/local/etc/rc.d/150.javamonitor.sh
Then

## JDBC jars location.

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