Wiki source code of Deployment-Solaris WO5.3.3

Version 31.1 by Pascal Robert on 2010/09/12 00:38

Show last authors
1 Setup WebObjects 5.3.3 on Solaris 10 x86
2 Rev 1 1.01.2008
3 Johann Werner (werner at isd dot uni-stuttgart dot de)
4 based on description of Francois Bientz for setup on FreeBSD
5
6 Rev 2 28.04.2008
7 John Bruce (john at kinrossgroup dot com)
8 added intial SMF scripts for wotaskd & javamonitor
9
10 That's the very first time I am using Solaris so I don't guarantee that my instructions are complete nor comply to standard Solaris naming/best-practice/whatsoever conventions. Feel free to comment/correct it!
11
12 What I used to test this setup:
13
14 Parallels Desktop
15 Solaris 10 8/07 x86 (Entire Solaris Software Group installation)
16 Access to an OS X Server 10.4.x machine that has the WO 5.3.3 files
17
18 = WebObjects 5.3.3 installation =
19
20 This section discusses how you "install" WO 5.3.3 on Solaris to use it as pure application server. You will be able to connect to WO apps by direct connect or use that machine from another machine that runs Apache with WOAdaptor.
21
22 Under Solaris create the following directory where all WO related files will be contained:
23
24 {{code}}
25
26 /opt/Apple
27
28 {{/code}}
29
30 Inside of this directory create:
31
32 {{code}}
33
34 /opt/Apple/Logs
35 /opt/Apple/Library/Frameworks
36 /opt/Apple/Library/PrivateFrameworks
37 /opt/Apple/Library/WebObjects
38 /opt/Apple/Local/Library/WebObjects/Applications
39 /opt/Apple/Local/Library/WebObjects/Extensions
40
41 {{/code}}
42
43 Then copy from the OS X Server machine these files from /System/Library/Frameworks
44
45 {{code}}
46
47 JavaDirectToWeb.framework
48 JavaDTWGeneration.framework
49 JavaEOAccess.framework
50 JavaEOApplication.framework
51 JavaEOCocoa.framework
52 JavaEOControl.framework
53 JavaEODistribution.framework
54 JavaEOGeneration.framework
55 JavaEOInterface.framework
56 JavaEOInterfaceCocoa.framework
57 JavaEOInterfaceSwing.framework
58 JavaEOProject.framework
59 JavaEORuleSystem.framework
60 JavaEOTool.framework
61 JavaFoundation.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 JavaXML.framework
71
72 {{/code}}
73
74 to /opt/Apple/Library/Frameworks
75
76 Next copy from the OS X Server machine these files from /System/Library/PrivateFrameworks
77
78 {{code}}
79
80 EOPlaceholders.framework
81 JavaMonitor.framework
82
83 {{/code}}
84
85 to /opt/Apple/Library/PrivateFrameworks
86
87 Copy from the OS X Server machine these files from /System/Library/WebObjects
88
89 {{code}}
90
91 JavaApplications
92 WODocumentRoot
93
94 {{/code}}
95
96 to /opt/Apple/Library/WebObjects
97
98 Finally you have to copy these files from /Library/WebObjects/Extensions
99
100 {{code}}
101
102 axis-ant.jar
103 axis.jar
104 commons-discovery.jar
105 commons-logging.jar
106 jaxrpc.jar
107 log4j-1.2.8.jar
108 saaj.jar
109 wsdl4j.jar
110
111 {{/code}}
112
113 to /opt/Apple/Local/Library/WebObjects/Extensions
114
115 == Create startup scripts for wotaskd and javamonitor ==
116
117 To be able to use the machine as an application server wotaskd has to run. To automatically start wotaskd on startup create the file /etc/rc3.d/S110.wotaskd
118
119 {{code}}
120
121 #!/bin/sh
122
123 NEXT_ROOT=/opt/Apple
124
125 case "$1" in
126 start)
127 export NEXT_ROOT
128 ${NEXT_ROOT}/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &
129 echo -n ' wotaskd'
130
131 ;;
132 stop)
133 lsof -i tcp:1085 |grep LISTEN | sort -u | awk '{print"kill -9 " $2}' | sh
134 ;;
135 *)
136 echo ""
137 echo "Usage: `basename $0` { start | stop }"
138 echo ""
139 exit 64
140 ;;
141 esac
142
143 {{/code}}
144
145 Then
146
147 {{panel}}
148
149 chmod \+x /etc/rc3.d/S110.wotaskd
150
151 {{/panel}}
152
153 If you need to start JavaMonitor too on that machine (remember: only **one** JavaMonitor per subnet) create /etc/rc3.d/S150.javamonitor
154
155 {{code}}
156
157 #!/bin/sh
158
159 NEXT_ROOT=/opt/Apple
160
161 case "$1" in
162 start)
163 export NEXT_ROOT
164 ${NEXT_ROOT}/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &
165 echo -n 'JavaMonitor'
166 ;;
167 stop)
168 lsof -i tcp:56789 |grep LISTEN | sort -u |awk '{print"kill -9 "$2}' | sh
169 ;;
170 *)
171 echo ""
172 echo "Usage: `basename $0` { start | stop }"
173 echo ""
174 exit 64
175 ;;
176 esac
177
178 {{/code}}
179
180 Then
181
182 {{panel}}
183
184 chmod \+x /etc/rc3.d/S150.javamonitor
185
186 {{/panel}}
187
188 To be done: Starting wotaskd and JavaMonitor under a specific user/group. As it is shown here the two apps will run with root priviliges. Another approach would be to put them into a Solaris Zone.
189 Also to be done: Instead of using init.d starting these services by SMF.
190
191 === Using SMF To Manage wotaskd & JavaMonitor ===
192
193 If you are running WO in a non global Zone the **lsof** command will not work as the ##/devices## directory is missing. An alternative to the above scripts are the [[Deployment-Solaris WO5.3.3^wotaskd.smf]] and [[Deployment-Solaris WO5.3.3^javamonitor.smf]] smf scripts attached to this page. I've tried then on a test server and they work for me but I'm a total SMF novice so **use these files at your own risk**.
194
195 Import the files with:
196
197 {{noformat}}
198
199 sudo svccfg import wotaskd.smf
200 sudo svccfg import javamonitor.smf
201
202 {{/noformat}}
203
204 They should start the wotaskd and javamonitor services but if not they can be enabled with:
205
206 {{noformat}}
207
208 sudo svcadm enable svc:/webobjects/wotaskd:default
209 sudo svcadm enable svc:/webobjects/javamonitor:default
210
211 {{/noformat}}
212
213 To confirm they are working kill the running java processes and they should restart. Also you can check the logs usually in ##/var/svc/logs##.
214
215 = Installing JDBC drivers =
216
217 If you want to access a database from your WO apps you have to install appropriate JDBC drivers. In this guide I will use FrontBase drivers as an example.
218
219 Download the database specific drivers from www.frontbase.com (called "WebObjects 5 Plugin" on the download page) and extract the archive. Then you should have two files:
220
221 {{code}}
222
223 FrontBasePlugIn.framework
224 frontbasejdbc.jar
225
226 {{/code}}
227
228 The first file is the one you have to add to your WO project. If you have WOnder you can exchange it with the one that comes with WOnder as it is an improved version (though I did not check for differences :)).
229 Put that file into
230
231 {{code}}
232
233 /opt/Apple/Local/Library/Frameworks
234
235 {{/code}}
236
237 The second file has to be put into the extensions directory of java
238
239 {{code}}
240
241 /usr/java/jre/lib/ext
242
243 {{/code}}
244
245 Reboot and you should be able to connect to a FB database from WO.
246
247 = Compiling WOAdaptor and Setting up Apache =
248
249 On Solaris 10 8/07 there is preinstalled Apache in versions 1.3 and 2.0. In this how-to we will compile an adaptor for Apache 2.0. It took me quite long to get the compile process right on Solaris so I changed some things and won't refer to the adaptor files in WOnder CVS. Instead get this [[SolarisAdaptor archive>>Deployment-Solaris WO5.3.3^SolarisAdaptor.zip]].
250
251 Put it e.g. into
252
253 {{code}}
254
255 /tmp
256
257 {{/code}}
258
259 Then unzip it with
260
261 {{code}}
262
263 unzip SolarisAdaptor.zip
264
265 {{/code}}
266
267 Next type in these commands
268
269 {{code}}
270
271 cd SolarisAdaptor
272 ./makeAdaptor.sh
273
274 {{/code}}
275
276 The file makeAdaptor.sh contains:
277
278 {{code}}
279
280 #!/bin/sh
281 /usr/apache2/bin/apxs -c -i -a -DSINGLE_THREADED_ADAPTOR mod_WebObjects.c appcfg.c cfgparse.c config.c hostlookup.c
282 list.c listing.c loadaverage.c loadbalancing.c log.c MoreURLCUtilities.c nbsocket.c PB.project Platform.c random.c
283 request.c response.c roundrobin.c shmem.c strdict.c strtbl.c transaction.c transport.c wastring.c womalloc.c
284 WOURLCUtilities_3.c WOURLCUtilities.c xmlcparser.c xmlctokenizer.c xmlparse.c
285
286 {{/code}}
287
288 It uses the apache extension tool to compile all source files, links them together and installs them in the right location for apache 2. It even inserts the LoadModule directive into your httpd.conf file! What a luxury ;)
289 You notice the "-DSINGLE//THREADED//ADAPTOR". You can change it to --DMULTIPLE//THREADED//ADAPTOR though I don't know if it works and exactly what advantages you will get from (besides having multiple threads).--
290
291 The next step is to put the WO config file into the right location:
292
293 {{code}}
294
295 cp webobjects.conf /etc/apache2/
296
297 {{/code}}
298
299 That config file has been altered in three ways:
300
301 * the LoadModule directive is commented out as it was automatically added to the main config file by apxs
302 * the WebObjectsDocumentRoot points to the standard apache2 location /var/apache2/htdocs
303 Change it if you have moved your htdocs to another place
304 * the WebObjectsAlias has been changed to /Apps/WebObjects
305 Feel free to modify the alias to any string you want. It has to be different from "cgi-bin" as it does not work. I didn't investigate on that. Note that you have to set the appropriate setting in JavaMonitor too. Go to JavaMonitor and click on the "Site" tab. On top there is a text field "URL to Adaptor". Put in the URL of your webserver with the changed WO alias.
306
307 Then lastly add as the last line of your current apache configuration file:
308
309 {{code}}
310
311 Include /etc/apache2/webobjects.conf
312
313 {{/code}}
314
315 **Please note that I don't guarantee that this adaptor works as intended. Use only at your own risk.**
316
317 = Running Apache =
318
319 The very last step is to start apache. On Solaris use the command:
320
321 {{code}}
322
323 svcadm enable apache2
324
325 {{/code}}
326
327 And check if it is really running
328
329 {{code}}
330
331 svcs -x apache2
332
333 {{/code}}