Version 25.1 by Johann Werner on 2008/01/03 12:12

Show last authors
1 Setup WebObjects 5.3.3 on Solaris 10 x86
2 Rev 1 1.01.2008
3 Johann Werner (werner@isd.uni-stuttgart.de)
4 based on description of Francois Bientz for setup on FreeBSD
5
6 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!
7
8 What I used to test this setup:
9
10 Parallels Desktop
11 Solaris 10 8/07 x86 (Entire Solaris Software Group installation)
12 Access to an OS X Server 10.4.x machine that has the WO 5.3.3 files
13
14 = WebObjects 5.3.3 installation =
15
16 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.
17
18 Under Solaris create the following directory where all WO related files will be contained:
19
20 {{code}}
21
22 /opt/Apple
23
24 {{/code}}
25
26 Inside of this directory create:
27
28 {{code}}
29
30 /opt/Apple/Logs
31 /opt/Apple/Library/Frameworks
32 /opt/Apple/Library/PrivateFrameworks
33 /opt/Apple/Library/WebObjects
34 /opt/Apple/Local/Library/WebObjects/Applications
35 /opt/Apple/Local/Library/WebObjects/Extensions
36
37 {{/code}}
38
39 Then copy from the OS X Server machine these files from /System/Library/Frameworks
40
41 {{code}}
42
43 JavaDirectToWeb.framework
44 JavaDTWGeneration.framework
45 JavaEOAccess.framework
46 JavaEOApplication.framework
47 JavaEOCocoa.framework
48 JavaEOControl.framework
49 JavaEODistribution.framework
50 JavaEOGeneration.framework
51 JavaEOInterface.framework
52 JavaEOInterfaceCocoa.framework
53 JavaEOInterfaceSwing.framework
54 JavaEOProject.framework
55 JavaEORuleSystem.framework
56 JavaEOTool.framework
57 JavaFoundation.framework
58 JavaJDBCAdaptor.framework
59 JavaJNDIAdaptor.framework
60 JavaWebObjects.framework
61 JavaWebServicesClient.framework
62 JavaWebServicesGeneration.framework
63 JavaWebServicesSupport.framework
64 JavaWOExtensions.framework
65 JavaWOJSPServlet.framework
66 JavaXML.framework
67
68 {{/code}}
69
70 to /opt/Apple/Library/Frameworks
71
72 Next copy from the OS X Server machine these files from /System/Library/PrivateFrameworks
73
74 {{code}}
75
76 EOPlaceholders.framework
77 JavaMonitor.framework
78
79 {{/code}}
80
81 to /opt/Apple/Library/PrivateFrameworks
82
83 Copy from the OS X Server machine these files from /System/Library/WebObjects
84
85 {{code}}
86
87 JavaApplications
88 WODocumentRoot
89
90 {{/code}}
91
92 to /opt/Apple/Library/WebObjects
93
94 Finally you have to copy these files from /Library/WebObjects/Extensions
95
96 {{code}}
97
98 axis-ant.jar
99 axis.jar
100 commons-discovery.jar
101 commons-logging.jar
102 jaxrpc.jar
103 log4j-1.2.8.jar
104 saaj.jar
105 wsdl4j.jar
106
107 {{/code}}
108
109 to /opt/Apple/Local/Library/WebObjects/Extensions
110
111 == Create startup scripts for wotaskd and javamonitor ==
112
113 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
114
115 {{code}}
116
117 #!/bin/sh
118
119 NEXT_ROOT=/opt/Apple
120
121 case "$1" in
122 start)
123 export NEXT_ROOT
124 ${NEXT_ROOT}/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &
125 echo -n ' wotaskd'
126
127 ;;
128 stop)
129 lsof -i tcp:1085 |grep LISTEN | sort -u | awk '{print"kill -9 " $2}' | sh
130 ;;
131 *)
132 echo ""
133 echo "Usage: `basename $0` { start | stop }"
134 echo ""
135 exit 64
136 ;;
137 esac
138
139 {{/code}}
140
141 Then
142
143 {{panel}}
144
145 chmod \+x /etc/rc3.d/S110.wotaskd
146
147 {{/panel}}
148
149 If you need to start JavaMonitor too on that machine (remember: only **one** JavaMonitor per subnet) create /etc/rc3.d/S150.javamonitor
150
151 {{code}}
152
153 #!/bin/sh
154
155 NEXT_ROOT=/opt/Apple
156
157 case "$1" in
158 start)
159 export NEXT_ROOT
160 ${NEXT_ROOT}/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &
161 echo -n 'JavaMonitor'
162 ;;
163 stop)
164 lsof -i tcp:56789 |grep LISTEN | sort -u |awk '{print"kill -9 "$2}' | sh
165 ;;
166 *)
167 echo ""
168 echo "Usage: `basename $0` { start | stop }"
169 echo ""
170 exit 64
171 ;;
172 esac
173
174 {{/code}}
175
176 Then
177
178 {{panel}}
179
180 chmod \+x /etc/rc3.d/S150.javamonitor
181
182 {{/panel}}
183
184 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.
185
186 = Installing JDBC drivers =
187
188 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.
189
190 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:
191
192 {{code}}
193
194 FrontBasePlugIn.framework
195 frontbasejdbc.jar
196
197 {{/code}}
198
199 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 :)).
200 Put that file into
201
202 {{code}}
203
204 /opt/Apple/Local/Library/Frameworks
205
206 {{/code}}
207
208 The second file has to be put into the extensions directory of java
209
210 {{code}}
211
212 /usr/java/jre/lib/ext
213
214 {{/code}}
215
216 Reboot and you should be able to connect to a FB database from WO.
217
218 = Compiling WOAdaptor and Setting up Apache =
219
220 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.
221
222 Put it e.g. into
223
224 {{code}}
225
226 /tmp
227
228 {{/code}}
229
230 Then unzip it with
231
232 {{code}}
233
234 unzip SolarisAdaptor.zip
235
236 {{/code}}
237
238 Next type in these commands
239
240 {{code}}
241
242 cd SolarisAdaptor
243 ./makeAdaptor.sh
244
245 {{/code}}
246
247 The file makeAdaptor.sh contains:
248
249 {{code}}
250
251 #!/bin/sh
252 /usr/apache2/bin/apxs -c -i -a -DSINGLE_THREADED_ADAPTOR mod_WebObjects.c appcfg.c cfgparse.c config.c hostlookup.c
253 list.c listing.c loadaverage.c loadbalancing.c log.c MoreURLCUtilities.c nbsocket.c PB.project Platform.c random.c
254 request.c response.c roundrobin.c shmem.c strdict.c strtbl.c transaction.c transport.c wastring.c womalloc.c
255 WOURLCUtilities_3.c WOURLCUtilities.c xmlcparser.c xmlctokenizer.c xmlparse.c
256
257 {{/code}}
258
259 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 ;)
260 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).--
261
262 The next step is to put the WO config file into the right location:
263
264 {{code}}
265
266 cp webobjects.conf /etc/apache2/
267
268 {{/code}}
269
270 That config file has been altered in three ways:
271
272 * the LoadModule directive is commented out as it was automatically added to the main config file by apxs
273 * the WebObjectsDocumentRoot points to the standard apache2 location /var/apache2/htdocs
274 Change it if you have moved your htdocs to another place
275 * the WebObjectsAlias has been changed to /Apps/WebObjects
276 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.
277
278 Then lastly add as the last line of your current apache configuration file:
279
280 {{code}}
281
282 Include /etc/apache2/webobjects.conf
283
284 {{/code}}
285
286 **Please note that I don't guarantee that this adaptor works as intended. Use only at your own risk.**
287
288 = Running Apache =
289
290 The very last step is to start apache. On Solaris use the command:
291
292 {{code}}
293
294 svcadm enable apache2
295
296 {{/code}}
297
298 And check if it is really running
299
300 {{code}}
301
302 svcs -x apache2
303
304 {{/code}}