Running Through Apache - Leopard Client 10.5.5 - Summary
This needs to be in one page - especially for beginners. I summarized my steps to run applications with Apache on a brand new Leopard install on the mailing list and it was suggested that it get put on the wiki. Please refer to the following pages if you need clarification:
Development Tools-Running Through Apache
4 Getting Started
You don't need to set your host in JavaMonitor. I thought you did too, but it wasn't the case. You should be able to just run your application from Eclipse and it will "magically" use Apache when it is starting up.
The steps I took as outlined in the wiki pages above:
1. Edit /etc/apache2/httpd.conf
Search for "Directory /" and comment out the Order and Deny lines:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Then search for "ServerName" and add
ServerName localhost
Add a line that points to the WebObjects apache config file
Include /System/Library/WebObjects/Adaptors/Apache2.2/apache.conf
2. My apache.conf (/System/Library/WebObjects/Adaptors/Apache2.2/apache.conf) file contained the line to load the WebObject module
Confirm that apache.conf also includes:
WebObjectsConfig http://localhost:1085 10
3. Add the launchd plist files necessary to start monitor and wotaskd during system startup to your /System/Library/LaunchDaemons/ directory. If you are using WO 5.4.x you can probably find the plists at /Developer/Examples/JavaWebObjects/Deployment/launchd/ If you cannot find them there, you can find instructions to produce them here: 4 Getting Started If you do not specify WOHost in your plist, you will need to add the "WOHost=localhost" to the properties file in wotaskd (/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties)
4. Change permissions of the launch daemon plists for wotaskd and monitor to exactly what is written in the wiki
644 system/wheel/everyone
// cd to the LaunchDaemons directory and execute the following commands
$ chmod 644 com.apple.webobjects.womonitor.plist
$ chmod 644 com.apple.webobjects.wotaskd.plist
$ sudo chown root:wheel com.apple.webobjects.womonitor.plist
$ sudo chown root:wheel com.apple.webobjects.wotaskd.plist
5. Set your launch parameters in your application:
WODirectConnectEnabled false
WOHost localhost
WOAdaptorURL http://localhost/cgi-bin/WebObjects
WOPort 5555
6. Update modWO
You will need to replace your modWebObjects.so located at /System/Library/WebObjects/Adaptors/Apache2.2/modWebObjects.so with the appropriate version of modWebObjects This will allow you to use SSL and solves a lot of problems where pages return No instance available errors. Make note of the original file's permissions and duplicate them on the replacement. Once you do this, restart Apache.
7. Load the LaunchDaemons. Make sure the filenames of the plists are the same as the module you're loading. I know this seems obvious, but it appears that the filenames have changed over time from "com.apple.webobjects.womonitor.plist" to "com.apple.womonitor.plist". The wiki calls for the loading of a module named "com.apple.webobjects.womonitor.plist" (notice the extra webobjects). You may not load the modules if you use the wiki instructions on the command line and don't notice the naming difference of the files.
If the LaunchDaemons are already loaded and you've made no changes, you should be able to start your application directly. If you've made changes and the LaunchDaemons are already loaded, you'll have to restart your machine to kick off launchd.
Steps 8, 9, 10. If that doesn't work, go back and double check every one of the settings. You'll probably find one of them has a typo or something. I am sure I did it three or four times before I finally got it all to work.