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