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://wocommunity.org/documents/tools
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/ chmod g+w /usr/local/apple/Local/Library/WebObjects/Configuration/
6. Place these two files in /usr/local/etc/rc.d/
directory: wotaskd and JavaMonitor
7. 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
8. 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/wocommunity/wonder.git
9. Inside the Project Wonder directory, navigate to the Utilities/Adaptors
directory:
cd Utilities/Adaptors
10. 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
11. 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
12. 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
13. Edit the /usr/local/etc/apache22/httpd.conf
file and make sure the LoadModule
line for the WebObjects module appears before LoadModule
for mod_rewrite
. If not, swap the order of both lines.
14. 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
toAll
in theAllow
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>
15. 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
16. 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
17. Edit /etc/rc.conf
again and add the following lines:
apache22_enable="YES"
18. 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.
Project Wonder
To install Project Wonder, assuming you performed all the previous steps and checked out Wonder from GitHub, do the following steps logged in as your username (not root!):
1. Install the port devel/apache-ant
if not yet installed.
2. Run the following command:
mkdir -p "~/Library/Application Support/WOLips/"
3. On that directory, create a file named wolips.properties
with the following content, adjusted to your paths:
#Wed Sep 17 01:33:31 WEST 2008 wo.system.root=/usr/local/apple wo.user.frameworks=/home/<username>/Library/Frameworks wo.system.frameworks=/usr/local/apple/Library/Frameworks wo.bootstrapjar=/usr/local/apple/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar wo.network.frameworks= wo.api.root= wo.network.root= wo.extensions=/usr/local/apple/Local/Library/WebObjects/Extensions wo.user.root=/home/<username> wo.local.frameworks=/usr/local/apple/Local/Library/Frameworks wo.apps.root=/usr/local/apple/Local/Library/WebObjects/Applications wo.local.root=/usr/local/apple/Local wo.systemroot=/usr/local/apple wo.wosystemroot=/usr/local/apple wo.wolocalroot=/usr/local/apple/Local wo.localroot=/usr/local/apple/Local wo.server.root=/usr/local/www/apache22/data/WebObjects
4. Create /usr/local/www/apache22/data/WebObjects
directory with write permission for group wheel
(or whatever group you are on).
5. Run the following command:
chmod -R g+w /usr/local/apple/Local/Library
Note that you can use more restrict permissions than the ones showed here. This should be only considered as an example.
6. cd
into the Wonder directory.
7. Run the commands:
ant frameworks ant frameworks.install
This will compile and install Wonder in your system, including the web server resources of Wonder frameworks, like Ajax.
2 Comments
Francois Bientz
Nice job Miguel
Franc
Francois Bientz
Works this FreeBSD deploy without some "chmod" on spawnofwotaskd.sh ??