What you need
- Windows 2003 Server; WIndows 2008 R2 (64 or 32 bit); Windows XP Professional
- Apache 2.2
- Java 1.5 or later
- a Mac with WebObjects 5.3 or 5.4 installed
Install Java and Apache
- Download and install Java J2SE 5.0
Java Version
You must install the multilingual option.
- Download and install apache 2.2
Installation Path
You cannot have any spaces in the installation path otherwise mod_webobjects won't work properly.
Copy WebObjects files from your Mac
In this description WebObjects will be installed on drive C: and apache is located under c:/apache.
Create the following directory tree under Windows
C:/Apple Library Frameworks WebObjects Configuration JavaApplications Local Library Frameworks WebObjects Applications Configuration Extensions
Copy the listed Frameworks from /System/Library/Frameworks to C:/Apple/Frameworks:
JavaDirectToWeb.framework JavaDTWGeneration.framework JavaEmbedding.framework JavaEOAccess.framework JavaEOApplication.framework JavaEOControl.framework JavaEODistribution.framework JavaEOGeneration.framework JavaEOInterface.framework JavaEOInterfaceCocoa.framework JavaEOInterfaceSwing.framework JavaEOProject.framework JavaEORuleSystem.framework JavaEOTool.framework JavaFoundation.framework JavaFrameEmbedding.framework JavaJDBCAdaptor.framework JavaJNDIAdaptor.framework JavaWebObjects.framework JavaWebServicesClient.framework JavaWebServicesGeneration.framework JavaWebServicesSupport.framework JavaWOExtensions.framework JavaWOJSPServlet.framework
Copying Frameworks
On MacOSX Frameworks are "versioned" using the symbolic link trick, this doesn't work on Windows.
Once copied, check each framework to make sure that the "Resources" and "WebServerResources" folders are in the ".framework" directory and not in a subdirectory (usually "Verisions\A\")
Copy JavaMonitor.woa and wotaskd.woa from /System/Library/WebObjects/JavaApplications to c:/Apple/Library/JavaApplications
Copy the content of /System/Library/WebObjects/WODocumentRoot to your apache document root directory. If you don't use D2W or D2JC I think you can omit the both Java folders.
If you are installing WebObjects 5.3 copy /System/Library/PrivateFrameworks/ to C:/Apple/Library
At least copy the jar files from /Library/WebObjects/Extensions to c:/Apple/Local/Library/WebObjects/Extensions.
axis.jar axis-ant.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar derby.jar derbyclient.jar jaxrpc.jar log4j-1.2.14.jar saaj.jar serializer.jar servlet.jar wsdl4j-1.5.1.jar xalan.jar xercesImpl.jar xml-apis.jar
Add environment variable
Under "System" add the environment variable NEXT_ROOT = C:/Apple
Installing the Apache Adaptor
Copy the mod_WebObjects.so file to c:/apache/modules
Hint
In some cases apache won't launch on a Windows Server system with this module.
In this case you should install the .Net Framework (3.x) on your system.
Configuring Apache
Open the httpd.conf file in c:/apache/conf and search for the line "LoadModule rewrite_module modules/mod_rewrite.so" and put the following line right befor that:
LoadModule WebObjects_module modules/mod_WebObjects.so
At the end of the httpd.conf file add the following lines:
# WebObjects 5.4: Enable the WebObjects module. loadModule should be added before mod_rewrite Include conf/extra/httpd-webobjects.conf
Find the <Directory /> entry and comment out the last two lines
<Directory /> Options FollowSymLinks AllowOverride None # Order deny,allow # Deny from all </Directory>
Create the file httpd-webobjects.conf in your c:/apache/conf/extra folder:
# WebObjects 5.4: Enable the WebObjects module. Should be loaded before mod_rewrite # LoadModule WebObjects_module modules/mod_WebObjects.so # Path to the Document Root of your Webserver, # it should contain a directory named WebObjects WebObjectsDocumentRoot c:/apache/htdocs # You can change the 'cgi-bin' part of WebObjectsAlias to whatever you # prefer (such as Apps), but the 'WebObjects' part is required. WebObjectsAlias /Apps/WebObjects # Here are the 3 possible configuration modes. # The apache module uses one of them to get information # about your deployed applications. # 1085 is the reserved port on which wotaskd processes listen to by default. # Host List Configuration # wotaskd is started automatically on supported platforms, # so this is the default mode. # The apache module gets its configuration from the wotaskds # listed on the configuration line # For multiple hosts: # WebObjectsConfig http://<name-of-a-host>:<port-on-a-host>,http://<name-of-another-host>:<port-on-a-host> <interval> # For localhost: WebObjectsConfig http://localhost:1085 10 # Multicast Configuration # The apache module gets its configuration from all wotaskds # that respond to the multicast call on the subnet # WebObjectsConfig webobjects://239.128.14.2:1085 10 # File Configuration # The apache module gets its configuration from one file # WebObjectsConfig file://<path-to-a-xml-config-file> 10 # To enable public access to the WOAdaptorInfo page, uncomment the following line # WebObjectsAdminUsername public # To enable the WOAdaptorInfo page with restricted access, # uncomment the next two lines and set the user and password # To access the WOAdaptorInfo page with restricted access, # use a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password. # WebObjectsAdminUsername user # WebObjectsAdminPassword password # To change the logging options, read the following comments: # The option name is "WebObjectsLog" and the first value indicates the path of the log file. # The second value indicates the log level. There are five, in decreasing informational order: # "Debug", "Info", "Warn", "Error", "User" # # Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user (usually root). # Under Windows create c:\TEMP\logWebObjects # The following line is the default: # WebObjectsLog /Library/WebObjects/Logs/WebObjects.log Debug
You had to restart your Apache Service to apply your changes.
Installing WOTaskDaemon as a Windows Service
Using Microsoft Windows 2003 resource kit
Microsoft provides free tools to register applications as services : instsrv and srvany.
Both are bundled with "Microsoft Windows 2003 resource kit" which can be downloaded here.
Below a quick translation of the KB469536 which describes their usage:
First create a new service using instsrv that refers to the srvany executable
C:\>C:\Program Files\Windows Resource Kits\Tools\Instsrv WOTaskD C:\Program Files\Windows Resource Kits\Tools\srvany.exe
Then fire regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WOTaskD
Add a sub-key named "Parameters".
In this sub-key add a new REG_SZ key named "Application" and put the path of the WOTaskD.cmd file.
Your reg key should now look like below :
To try your newly created service simply start it by typing :
C:\>net start WOTaskD
You should be aware that srvany is just a laucher, this means that the "service" has no control over WOTaskD's sub-processes:
stopping the service has no effect on WOTaskD. For now the only solution I found is to use the following lines in a cmd file :
net stop apache2.2 net stop wotaskd taskkill /F /IM java.exe /T
Using FireDameon
You can use FireDaemon and add a new Service:
Executable: C:\Apple\Library\WebObjects\JavaApplications\wotaskd.woa\wotaskd.CMD
Working Directory:C:\Apple\Library\WebObjects\JavaApplications\wotaskd.woa
To test the system you can also install WO Monitor as a service:
Executable: C:\Apple\Library\WebObjects\JavaApplications\JavaMonitor.woa\JavaMonitor.CMD
Working Directory:C:\Apple\Library\WebObjects\JavaApplications\JavaMonitor.woa
Testing the installation
Now that everything should be set up properly, it is time for a small test. First, let's look if wotaskd is working.
Open a browser and go to http://<myhost>:1085If it works, you should see the host's configuration displayed in the browser. Now, start WOMonitor (double click on ...\JavaMonitor.woa\JavaMonitor.CMD) if it is not already running as a service.
Wait a few seconds, then point the browser to http://<myhost>:56789
You should see Monitor's main window. Now you can start deploying your applications.
Solving issues
The requested URL [WO:...] was not found
By default as configured in the httpd-webobjects.conf file the alias for the adaptor is "/Apps/WebObjects".
WebObjectsAlias /Apps/WebObjects
You can change this and restore the "/cgi-bin/WebObjects" path by changing this variable.
If you wish to keep the default value (or use a custom value) do not forget to change the adaptor path in the "Site" tab of JavaMonitor
2 Comments
Klaus Berkling
These instructions are good and basically work. In a strict Microsoft deployment environment using WOStart is probably better then FireDamon or other Java wrappers.
The way to install WOStart is to rename the executable wotaskd.exe and Javamonitor.exe and place it in the same directory as each their UNIX or Windows shell scripts.
To install wotaskd as a service (you have to run Windows PowerShell as Administrator):
You can repeat the same for JavaMonitor. I edited the Properties file for JavaMonitor to set the port.
Maik Musall
Precompiled WOStart.exe for Windows 32 and 64 bit with JRE8, produced by Markus Stoll: