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