Wiki source code of Deploying on Windows
Version 50.1 by Pascal Robert on 2012/02/11 08:43
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{toc/}} | ||
| 2 | |||
| 3 | = What you need = | ||
| 4 | |||
| 5 | * Windows 2003 Server; WIndows 2008 R2 (64 or 32 bit); Windows XP Professional | ||
| 6 | * Apache 2.2 | ||
| 7 | * Java 1.5 or later | ||
| 8 | * a Mac with WebObjects 5.3 or 5.4 installed | ||
| 9 | |||
| 10 | = Install Java and Apache = | ||
| 11 | |||
| 12 | * Download and install [[Java J2SE 5.0>>url:http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html||shape="rect"]] | ||
| 13 | * {{note title="Java Version"}}You must install the multilingual option.{{/note}}Download and install [[apache 2.2>>url:http://httpd.apache.org||shape="rect"]] | ||
| 14 | |||
| 15 | {{note title="Installation Path"}} | ||
| 16 | You cannot have any spaces in the installation path otherwise mod_webobjects won't work properly. | ||
| 17 | {{/note}} | ||
| 18 | |||
| 19 | = Copy WebObjects files from your Mac = | ||
| 20 | |||
| 21 | In this description WebObjects will be installed on drive C: and apache is located under c:/apache. | ||
| 22 | |||
| 23 | Create the following directory tree under Windows | ||
| 24 | |||
| 25 | {{code}} | ||
| 26 | |||
| 27 | C:/Apple | ||
| 28 | Library | ||
| 29 | Frameworks | ||
| 30 | WebObjects | ||
| 31 | Configuration | ||
| 32 | JavaApplications | ||
| 33 | Local | ||
| 34 | Library | ||
| 35 | Frameworks | ||
| 36 | WebObjects | ||
| 37 | Applications | ||
| 38 | Configuration | ||
| 39 | Extensions | ||
| 40 | |||
| 41 | {{/code}} | ||
| 42 | |||
| 43 | Copy the listed Frameworks from /System/Library/Frameworks to C:/Apple/Frameworks: | ||
| 44 | |||
| 45 | {{code}} | ||
| 46 | JavaDirectToWeb.framework | ||
| 47 | JavaDTWGeneration.framework | ||
| 48 | JavaEmbedding.framework | ||
| 49 | JavaEOAccess.framework | ||
| 50 | JavaEOApplication.framework | ||
| 51 | JavaEOControl.framework | ||
| 52 | JavaEODistribution.framework | ||
| 53 | JavaEOGeneration.framework | ||
| 54 | JavaEOInterface.framework | ||
| 55 | JavaEOInterfaceCocoa.framework | ||
| 56 | JavaEOInterfaceSwing.framework | ||
| 57 | JavaEOProject.framework | ||
| 58 | JavaEORuleSystem.framework | ||
| 59 | JavaEOTool.framework | ||
| 60 | JavaFoundation.framework | ||
| 61 | JavaFrameEmbedding.framework | ||
| 62 | JavaJDBCAdaptor.framework | ||
| 63 | JavaJNDIAdaptor.framework | ||
| 64 | JavaWebObjects.framework | ||
| 65 | JavaWebServicesClient.framework | ||
| 66 | JavaWebServicesGeneration.framework | ||
| 67 | JavaWebServicesSupport.framework | ||
| 68 | JavaWOExtensions.framework | ||
| 69 | JavaWOJSPServlet.framework | ||
| 70 | {{/code}} | ||
| 71 | |||
| 72 | {{note title="Copying Frameworks"}} | ||
| 73 | On MacOSX Frameworks are "versioned" using the symbolic link trick, this doesn't work on Windows. | ||
| 74 | 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\") | ||
| 75 | {{/note}} | ||
| 76 | |||
| 77 | Copy JavaMonitor.woa and wotaskd.woa from /System/Library/WebObjects/JavaApplications to c:/Apple/Library/JavaApplications | ||
| 78 | |||
| 79 | 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. | ||
| 80 | |||
| 81 | If you are installing WebObjects 5.3 copy /System/Library/PrivateFrameworks/ to C:/Apple/Library | ||
| 82 | |||
| 83 | At least copy the jar files from /Library/WebObjects/Extensions to c:/Apple/Local/Library/WebObjects/Extensions. | ||
| 84 | |||
| 85 | {{code}} | ||
| 86 | |||
| 87 | axis.jar | ||
| 88 | axis-ant.jar | ||
| 89 | commons-discovery-0.2.jar | ||
| 90 | commons-logging-1.0.4.jar | ||
| 91 | derby.jar | ||
| 92 | derbyclient.jar | ||
| 93 | jaxrpc.jar | ||
| 94 | log4j-1.2.14.jar | ||
| 95 | saaj.jar | ||
| 96 | serializer.jar | ||
| 97 | servlet.jar | ||
| 98 | wsdl4j-1.5.1.jar | ||
| 99 | xalan.jar | ||
| 100 | xercesImpl.jar | ||
| 101 | xml-apis.jar | ||
| 102 | |||
| 103 | {{/code}} | ||
| 104 | |||
| 105 | = Add environment variable = | ||
| 106 | |||
| 107 | Under "System" add the environment variable NEXT_ROOT = C:/Apple | ||
| 108 | |||
| 109 | = Installing the Apache Adaptor = | ||
| 110 | |||
| 111 | Copy the [[mod_WebObjects.so>>url:http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.2/windows/mod_WebObjects.so||shape="rect"]] file to c:/apache/modules | ||
| 112 | |||
| 113 | {{info title="Hint"}} | ||
| 114 | In some cases apache won't launch on a Windows Server system with this module. | ||
| 115 | In this case you should install the .Net Framework (3.x) on your system. | ||
| 116 | {{/info}} | ||
| 117 | |||
| 118 | = Configuring Apache = | ||
| 119 | |||
| 120 | 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: | ||
| 121 | |||
| 122 | {{code}} | ||
| 123 | |||
| 124 | LoadModule WebObjects_module modules/mod_WebObjects.so | ||
| 125 | |||
| 126 | {{/code}} | ||
| 127 | |||
| 128 | At the end of the httpd.conf file add the following lines: | ||
| 129 | |||
| 130 | {{code}} | ||
| 131 | |||
| 132 | # WebObjects 5.4: Enable the WebObjects module. loadModule should be added before mod_rewrite | ||
| 133 | Include conf/extra/httpd-webobjects.conf | ||
| 134 | |||
| 135 | {{/code}} | ||
| 136 | |||
| 137 | Find the <Directory /> entry and comment out the last two lines | ||
| 138 | |||
| 139 | {{code}} | ||
| 140 | |||
| 141 | <Directory /> | ||
| 142 | Options FollowSymLinks | ||
| 143 | AllowOverride None | ||
| 144 | # Order deny,allow | ||
| 145 | # Deny from all | ||
| 146 | </Directory> | ||
| 147 | |||
| 148 | {{/code}} | ||
| 149 | |||
| 150 | Create the file httpd-webobjects.conf in your c:/apache/conf/extra folder: | ||
| 151 | |||
| 152 | {{code}} | ||
| 153 | |||
| 154 | # WebObjects 5.4: Enable the WebObjects module. Should be loaded before mod_rewrite | ||
| 155 | # LoadModule WebObjects_module modules/mod_WebObjects.so | ||
| 156 | |||
| 157 | # Path to the Document Root of your Webserver, | ||
| 158 | # it should contain a directory named WebObjects | ||
| 159 | WebObjectsDocumentRoot c:/apache/htdocs | ||
| 160 | |||
| 161 | # You can change the 'cgi-bin' part of WebObjectsAlias to whatever you | ||
| 162 | # prefer (such as Apps), but the 'WebObjects' part is required. | ||
| 163 | WebObjectsAlias /Apps/WebObjects | ||
| 164 | |||
| 165 | # Here are the 3 possible configuration modes. | ||
| 166 | # The apache module uses one of them to get information | ||
| 167 | # about your deployed applications. | ||
| 168 | # 1085 is the reserved port on which wotaskd processes listen to by default. | ||
| 169 | |||
| 170 | # Host List Configuration | ||
| 171 | # wotaskd is started automatically on supported platforms, | ||
| 172 | # so this is the default mode. | ||
| 173 | # The apache module gets its configuration from the wotaskds | ||
| 174 | # listed on the configuration line | ||
| 175 | # For multiple hosts: | ||
| 176 | # WebObjectsConfig http://<name-of-a-host>:<port-on-a-host>,http://<name-of-another-host>:<port-on-a-host> <interval> | ||
| 177 | # For localhost: | ||
| 178 | WebObjectsConfig http://localhost:1085 10 | ||
| 179 | |||
| 180 | # Multicast Configuration | ||
| 181 | # The apache module gets its configuration from all wotaskds | ||
| 182 | # that respond to the multicast call on the subnet | ||
| 183 | # WebObjectsConfig webobjects://239.128.14.2:1085 10 | ||
| 184 | |||
| 185 | # File Configuration | ||
| 186 | # The apache module gets its configuration from one file | ||
| 187 | # WebObjectsConfig file://<path-to-a-xml-config-file> 10 | ||
| 188 | |||
| 189 | # To enable public access to the WOAdaptorInfo page, uncomment the following line | ||
| 190 | # WebObjectsAdminUsername public | ||
| 191 | |||
| 192 | # To enable the WOAdaptorInfo page with restricted access, | ||
| 193 | # uncomment the next two lines and set the user and password | ||
| 194 | # To access the WOAdaptorInfo page with restricted access, | ||
| 195 | # use a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password. | ||
| 196 | # WebObjectsAdminUsername user | ||
| 197 | # WebObjectsAdminPassword password | ||
| 198 | |||
| 199 | # To change the logging options, read the following comments: | ||
| 200 | # The option name is "WebObjectsLog" and the first value indicates the path of the log file. | ||
| 201 | # The second value indicates the log level. There are five, in decreasing informational order: | ||
| 202 | # "Debug", "Info", "Warn", "Error", "User" | ||
| 203 | # | ||
| 204 | # Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user (usually root). | ||
| 205 | # Under Windows create c:\TEMP\logWebObjects | ||
| 206 | |||
| 207 | # The following line is the default: | ||
| 208 | # WebObjectsLog /Library/WebObjects/Logs/WebObjects.log Debug | ||
| 209 | |||
| 210 | {{/code}} | ||
| 211 | |||
| 212 | You had to restart your Apache Service to apply your changes. | ||
| 213 | |||
| 214 | = Installing WOTaskDaemon as a Windows Service = | ||
| 215 | |||
| 216 | === Using Microsoft Windows 2003 resource kit === | ||
| 217 | |||
| 218 | Microsoft provides free tools to register applications as services : instsrv and srvany. | ||
| 219 | Both are bundled with "Microsoft Windows 2003 resource kit" which can be downloaded [[here>>url:http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en||shape="rect"]]. | ||
| 220 | |||
| 221 | Below a quick translation of the [[KB469536>>url:http://support.microsoft.com/kb/469536/fr||shape="rect"]] which describes their usage: | ||
| 222 | |||
| 223 | First create a new service using instsrv that refers to the srvany executable | ||
| 224 | |||
| 225 | {{code}} | ||
| 226 | |||
| 227 | C:\>C:\Program Files\Windows Resource Kits\Tools\Instsrv WOTaskD C:\Program Files\Windows Resource Kits\Tools\srvany.exe | ||
| 228 | |||
| 229 | {{/code}} | ||
| 230 | |||
| 231 | Then fire regedit and navigate to **HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WOTaskD** | ||
| 232 | Add a sub-key named "Parameters". | ||
| 233 | In this sub-key add a new REG_SZ key named "Application" and put the path of the WOTaskD.cmd file. | ||
| 234 | |||
| 235 | Your reg key should now look like below : | ||
| 236 | [[image:attach:wotaskd_reg.png]] | ||
| 237 | To try your newly created service simply start it by typing : | ||
| 238 | |||
| 239 | {{code}} | ||
| 240 | |||
| 241 | C:\>net start WOTaskD | ||
| 242 | |||
| 243 | {{/code}} | ||
| 244 | |||
| 245 | You should be aware that srvany is just a laucher, this means that the "service" has no control over WOTaskD's sub-processes: | ||
| 246 | 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 : | ||
| 247 | |||
| 248 | {{code}} | ||
| 249 | |||
| 250 | net stop apache2.2 | ||
| 251 | net stop wotaskd | ||
| 252 | taskkill /F /IM java.exe /T | ||
| 253 | |||
| 254 | {{/code}} | ||
| 255 | |||
| 256 | === Using FireDameon === | ||
| 257 | |||
| 258 | You can use FireDaemon and add a new Service: | ||
| 259 | Executable: C:\Apple\Library\WebObjects\JavaApplications\wotaskd.woa\wotaskd.CMD | ||
| 260 | Working Directory:C:\Apple\Library\WebObjects\JavaApplications\wotaskd.woa | ||
| 261 | |||
| 262 | To test the system you can also install WO Monitor as a service: | ||
| 263 | Executable: C:\Apple\Library\WebObjects\JavaApplications\JavaMonitor.woa\JavaMonitor.CMD | ||
| 264 | Working Directory:C:\Apple\Library\WebObjects\JavaApplications\JavaMonitor.woa | ||
| 265 | |||
| 266 | = Testing the installation = | ||
| 267 | |||
| 268 | Now that everything should be set up properly, it is time for a small test. First, let's look if wotaskd is working. | ||
| 269 | |||
| 270 | 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. | ||
| 271 | Wait a few seconds, then point the browser to http:~/~/<myhost>:56789 | ||
| 272 | |||
| 273 | You should see Monitor's main window. Now you can start deploying your applications. | ||
| 274 | |||
| 275 | = Solving issues = | ||
| 276 | |||
| 277 | === The requested URL [WO:...] was not found === | ||
| 278 | |||
| 279 | By default as configured in the httpd-webobjects.conf file the alias for the adaptor is "/Apps/WebObjects". | ||
| 280 | |||
| 281 | {{code}} | ||
| 282 | |||
| 283 | WebObjectsAlias /Apps/WebObjects | ||
| 284 | |||
| 285 | {{/code}} | ||
| 286 | |||
| 287 | You can change this and restore the "/cgi-bin/WebObjects" path by changing this variable. | ||
| 288 | |||
| 289 | 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 |