FreeBSD 8.2 and WebObjects 5.4.3
This page describes the steps to install WebObjects 5.4.3 from scratch on a modern FreeBSD 8.2 system. This instructions do not include using the WOPort, as described in Deploying on FreeBSD 6.x and 7.x (WO 5.3.3). Although the WOPort would save a lot of time, it's not being actively maintained, and AFAIK does not support WO 5.4.3. This instructions are based on WOInstaller.jar, and provide all the necessary steps to a working deployment environment, including Apache web server integration.
The following steps assume you have installed the necessary ports. Those include java/diablo-jdk16, www/apache22 and devel/git.
1. Download WOInstaller.jar from http://webobjects.mdimension.com/wolips/
2. As root, create the /usr/local/apple directory:
mkdir /usr/local/apple
3. Run the following command to install the WebObjects frameworks in the directory just created:
java -jar WOInstaller.jar 5.4.3 /usr/local/apple
4. Edit /etc/rc.conf and add the following lines:
## WebObjects ##
JavaMonitor_enable="YES"
wotaskd_enable="YES"
5. Run the following commands to create needed directories and set correct permissions:
mkdir /var/run/webobjects/
mkdir /var/log/webobjects/
chmod ugo+x /usr/local/apple/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd
chmod ugo+x /usr/local/apple/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor
chgrp www /usr/local/apple/Local/Library/WebObjects/Configuration/
chgrp g+w /usr/local/apple/Local/Library/WebObjects/Configuration/
6. Run the following commands to start wotaskd and JavaMonitor. After running this commands, your system should be running wotaskd and JavaMonitor. You can verify that by running top or ps. Also, you should take the time now to configure JavaMonitor, including setting the administration password.
/usr/local/etc/rc.d/wotaskd start
/usr/local/etc/rc.d/JavaMonitor start
7. We need to checkout Project Wonder to obtain a copy of the Apache adaptor source. To do that, cd to a work directory, and run the following command. This will checkout Project Wonder from GitHub.
git clone https://github.com/projectwonder/wonder.git
8. Inside the Project Wonder directory, navigate to the Utilities/Adaptors directory:
cd Utilities/Adaptors
9. Edit the make.config file, and set the OS to FreeBSD by changing the following line:
# Set the platform you are building on
ADAPTOR_OS = FreeBSD
10. Run the gmake command on that directory. Note that you have to run gmake and not make. Also, do not change directory to Apache2.2. The command should be run on the Utilities/Adaptors directory.
gmake
11. After successful compilation, enter Utilities/Adaptors/Apache2.2 directory and install the module on Apache:
cd Apache2.2
apxs -i -a -n WebObjects mod_WebObjects.la
12. Edit the /usr/local/etc/apache22/httpd.conf file and make sure the LoadModule line for the WebObjects module appears before LoadModule for modrewrite. If not, swap the order of both lines.
13. Still in /usr/local/etc/apache22/httpd.conf file, tweak the following configurations (you can do however you want, this are just suggestions to make it run plain and simply):
- Change None to All in the Allow line of the following configuration section:
<Directory />
AllowOverride None
Order deny,allow
Allow from all
</Directory>
- Comment out the following line and section, if you want to use the default /cgi-bin/WebObects URL for the WebObjects module:
# ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"
#<Directory "/usr/local/www/apache22/cgi-bin">
# AllowOverride None
# Options None
# Order allow,deny
# Allow from all
#</Directory>
14. Assuming you're still in Wonder's Utilities/Adaptors/Apache2.2 directory (cd to it if you left it in the previous step), copy the following file to the Apache configuration directory:
cp apache.conf /usr/local/etc/apache22/Includes/wo.conf
15. Edit the destination file (/usr/local/etc/apache22/Includes/wo.conf). You need to make two changes:
- Comment out the LoadModule line, as the module is already loaded by httpd.conf.
- Set WebObjectsDocumentRoot to /usr/local/www/apache22/data:
WebObjectsDocumentRoot /usr/local/www/apache22/data
16. Edit /etc/rc.conf again and add the following lines:
apache22_enable="YES"
17. Run the following command to launch Apache:
/usr/local/etc/rc.d/apache22 start
You should now have a working web server and WebObjects deployment environment. Try to open your browser and access http://<your-server-name>/cgi-bin/WebObjects/app.woa and you should see the error "The requested application was not found on this server." generated by the WebObjects adaptor.