Preparing the system
Extracting the WebObjects Runtime
Before you can install the WebObjects Runtime you must first extract the necessary files from the WebObjects Runtime disk image that Apple uses to distribute the software. You will need to use a Mac to do this as the DMG file format is not supported by other platforms.
- Fetch the WebObjects 5.3.3 Runtime from Apple's website
- Mount the disk image on a Mac and copy the package archive from within the package's Resources folder to the FreeBSD system's ports distfiles directory. Note: The following assumes you have sudo installed on the FreeBSD system
cd '/Volumes/WebObjects 5.3.3 Developer Update/WebObjects5.3.3Update.pkg/Contents/Resources' scp WebObjects5.3.3Update.pax.gz deployment.host:/tmp ssh deployment.host sudo mv /tmp/WebObjects5.3.3Update.pax.gz /usr/ports/distfiles
Alternative File extraction technique
It is possible to extract the required package archive from the DMG without mounting it using the following commands.
dd if=WebObjects5.3.3Update.dmg bs=0x1000 skip=0xb12 of=WebObjects5.3.3Update.pax.gz perl -e 'truncate "WebObjects5.3.3Update.pax.gz", 29672581'
Updating the FreeBSD Ports tree
The Ports tree for FreeBSD is constantly being updated and it is important that you have updated the local ports tree before proceeding any further.
Use portsnap to update the ports tree
portsnap fetch extract
Installing Java
Java for FreeBSD can be installed either as a package or a port. Either way requires that certain items be downloaded manually, for instructions on downloading and installing the Sun JDK from source visit the FreeBSD Java Project website. The binary JDK distribution for FreeBSD is known as Diablo and is available from the FreeBSD Foundation Java Downloads site. Although WebObjects is certified against JDK 1.4, there are no known issues with using JDK 1.5 and it is suggested that you try this version first.
Installing the Diablo JDK 1.5 port after downloading the necessary distfiles might look something like this:
cd /usr/ports/java/diablo-jdk15 make install
Extracting WOPorts
Download and extract the WOPorts bundle into your home directory
cd ~ tar -zxf woports-20070519.tgz
Installing a web server
If you intend to setup a WOAdaptor front end on the machine then it is recommended you install the web server of your choice first. Currently supported web servers are Apache, nginx and lighttpd.
To install Apache 1.3 + SSL you would do this:
cd /usr/ports/www/apache13-ssl make install
Installing the WebObjects Runtime
Configure & Install the WebObjects Deployment port
The WebObjects Deployment port allows you to automatically install the webobjects runtime as well as a variety of WebObjects related dependencies. These include WOAdaptors for Apache and CGI/FastCGI, JDBC & EOF plugins (for FrontBase, PostgreSQL, MySQL & OpenBase), Project Wonder and WOProject.
You can configure your preferred options and install the port like this:
#cd ~/ports/www/webobjects-deploy #make config Options for webobjects-deploy 1.0 [X] APACHE Install Apache Module Adaptor [ ] WOADAPTOR Install Web Server CGI Adaptor [X] FASTCGI FastCGI support [X] EOACCESS Install EOF Database Plugins [X] FRONTBASE FrontBase support [X] POSTGRESQL PostgreSQL support [X] MYSQL MySQL support [ ] OPENBASE OpenBase support [ ] WONDER Install Project Wonder [ ] APPLICATIONS Applications Bundle [ ] EXAMPLES Examples Bundle [ ] DOCS Documentation Bundle [ ] WONDERNIGHTLY Use Wonder from Nightly Builds [ ] WONDERCVS Use Wonder from CVS [ ] WOPROJECT Install WOProject Ant tasks [ ] WOLIPSNIGHTLY Use WOProject from Nightly Builds [ ] WOLIPSSVN Use WOProject from Subversion [ ] COMPILE Compile from source where available #make install
Configuring JavaMonitor & wotaskd
To use JavaMonitor and wotaskd you will need to configure them to run on startup.
Edit /etc/rc.conf and add the following lines:
JavaMonitor_enable="YES" wotaskd_enable="YES"
To run them manually without rebooting do the following:
/usr/local/etc/rc.d/wotaskd start /usr/local/etc/rc.d/JavaMonitor start
Configuring the web server
Apache
If you are using Apache as your front end, and have installed the WebObjects Apache module, you will need to make some minor modifications to the standard configuration to make things work.
- Comment out the ScriptAlias /cgi-bin/ statement
The standard apache config comes with a ScriptAlias to allow /cgi-bin/ scripts to be run, this interferes with the default webobjects config so you will want to disable it. - Include the webobjects.conf file
If you are using Apache 1.3 add the following line to the end of your /usr/local/etc/apache/httpd.conf file:Include /usr/local/etc/apache/webobjects.conf
Nginx
If you are using nginx as your front end, and have installed the FastCGI adaptor, you will need to add the following declaration to the server configuration in order to enable the adaptor.
# WebObjects Adaptor config location /cgi-bin/WebObjects { set $path_info ""; set $script_name /cgi-bin/WebObjects; if ($fastcgi_script_name ~ "^/cgi-bin/WebObjects(/.+)$") { set $path_info $1; } fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_NAME $script_name; fastcgi_pass unix:/tmp/woadaptor.sock; include fastcgi_params; } location /WebObjects { root /usr/local/www/webobjects; }
You will also need to enable the FastCGI service to run on startup by adding the following line to /etc/rc.conf
woadaptor_enable="YES"
Lighttpd
If you are using lighttpd as your front end, and have installed the FastCGI adaptor, you will need to add the following declaration to the server configuration in order to enable the adaptor.
fastcgi.server = ( "/cgi-bin/WebObjects" => ( "WebObjects" => ( "socket" => "/tmp/woadaptor.sock", "check-local" => "disable", "bin-path" => "/usr/local/libexec/WebObjects-fcgi", "bin-environment" => ( "WO_CONFIG_URL" => "http://localhost:1085", "WO_ADAPTOR_INFO_USERNAME" => "userhere", "WO_ADAPTOR_INFO_PASSWORD" => "passhere", ) )) ) alias.url = ( "/WebObjects/" => "/usr/local/www/webobjects/" ) $HTTP["url"] =~ "^/WebObjects($|/)" { dir-listing.activate = "disable" }