Wiki source code of Deploying on Solaris (WO 5.3.3) (DELETABLE)
Last modified by Ray Kiddy on 2021/05/01 01:53
Show last authors
author | version | line-number | content |
---|---|---|---|
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 | chmod +x /etc/rc3.d/S110.wotaskd | ||
149 | {{/panel}} | ||
150 | |||
151 | If you need to start JavaMonitor too on that machine (remember: only **one** JavaMonitor per subnet) create /etc/rc3.d/S150.javamonitor | ||
152 | |||
153 | {{code}} | ||
154 | |||
155 | #!/bin/sh | ||
156 | |||
157 | NEXT_ROOT=/opt/Apple | ||
158 | |||
159 | case "$1" in | ||
160 | start) | ||
161 | export NEXT_ROOT | ||
162 | ${NEXT_ROOT}/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 & | ||
163 | echo -n 'JavaMonitor' | ||
164 | ;; | ||
165 | stop) | ||
166 | lsof -i tcp:56789 |grep LISTEN | sort -u |awk '{print"kill -9 "$2}' | sh | ||
167 | ;; | ||
168 | *) | ||
169 | echo "" | ||
170 | echo "Usage: `basename $0` { start | stop }" | ||
171 | echo "" | ||
172 | exit 64 | ||
173 | ;; | ||
174 | esac | ||
175 | |||
176 | {{/code}} | ||
177 | |||
178 | Then | ||
179 | |||
180 | {{panel}} | ||
181 | chmod +x /etc/rc3.d/S150.javamonitor | ||
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 | Also to be done: Instead of using init.d starting these services by SMF. | ||
186 | |||
187 | === Using SMF To Manage wotaskd & JavaMonitor === | ||
188 | |||
189 | If you are running WO in a non global Zone the **lsof** command will not work as the {{code language="none"}}/devices{{/code}} directory is missing. An alternative to the above scripts are the [[attach:WO.Deploying on Solaris (WO 5.3.3)@wotaskd.smf]] and [[attach:WO.Deploying on Solaris (WO 5.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**. | ||
190 | |||
191 | Import the files with: | ||
192 | |||
193 | {{noformat}} | ||
194 | |||
195 | sudo svccfg import wotaskd.smf | ||
196 | sudo svccfg import javamonitor.smf | ||
197 | |||
198 | {{/noformat}} | ||
199 | |||
200 | They should start the wotaskd and javamonitor services but if not they can be enabled with: | ||
201 | |||
202 | {{noformat}} | ||
203 | |||
204 | sudo svcadm enable svc:/webobjects/wotaskd:default | ||
205 | sudo svcadm enable svc:/webobjects/javamonitor:default | ||
206 | |||
207 | {{/noformat}} | ||
208 | |||
209 | To confirm they are working kill the running java processes and they should restart. Also you can check the logs usually in {{code language="none"}}/var/svc/logs{{/code}}. | ||
210 | |||
211 | = Installing JDBC drivers = | ||
212 | |||
213 | 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. | ||
214 | |||
215 | 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: | ||
216 | |||
217 | {{code}} | ||
218 | |||
219 | FrontBasePlugIn.framework | ||
220 | frontbasejdbc.jar | ||
221 | |||
222 | {{/code}} | ||
223 | |||
224 | 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 ). | ||
225 | Put that file into | ||
226 | |||
227 | {{code}} | ||
228 | |||
229 | /opt/Apple/Local/Library/Frameworks | ||
230 | |||
231 | {{/code}} | ||
232 | |||
233 | The second file has to be put into the extensions directory of java | ||
234 | |||
235 | {{code}} | ||
236 | |||
237 | /usr/java/jre/lib/ext | ||
238 | |||
239 | {{/code}} | ||
240 | |||
241 | Reboot and you should be able to connect to a FB database from WO. | ||
242 | |||
243 | = Compiling WOAdaptor and Setting up Apache = | ||
244 | |||
245 | 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>>attach:WO.Deploying on Solaris (WO 5.3.3)@SolarisAdaptor.zip]]. | ||
246 | |||
247 | Put it e.g. into | ||
248 | |||
249 | {{code}} | ||
250 | |||
251 | /tmp | ||
252 | |||
253 | {{/code}} | ||
254 | |||
255 | Then unzip it with | ||
256 | |||
257 | {{code}} | ||
258 | |||
259 | unzip SolarisAdaptor.zip | ||
260 | |||
261 | {{/code}} | ||
262 | |||
263 | Next type in these commands | ||
264 | |||
265 | {{code}} | ||
266 | |||
267 | cd SolarisAdaptor | ||
268 | ./makeAdaptor.sh | ||
269 | |||
270 | {{/code}} | ||
271 | |||
272 | The file makeAdaptor.sh contains: | ||
273 | |||
274 | {{code}} | ||
275 | |||
276 | #!/bin/sh | ||
277 | /usr/apache2/bin/apxs -c -i -a -DSINGLE_THREADED_ADAPTOR mod_WebObjects.c appcfg.c cfgparse.c config.c hostlookup.c | ||
278 | list.c listing.c loadaverage.c loadbalancing.c log.c MoreURLCUtilities.c nbsocket.c PB.project Platform.c random.c | ||
279 | request.c response.c roundrobin.c shmem.c strdict.c strtbl.c transaction.c transport.c wastring.c womalloc.c | ||
280 | WOURLCUtilities_3.c WOURLCUtilities.c xmlcparser.c xmlctokenizer.c xmlparse.c | ||
281 | |||
282 | {{/code}} | ||
283 | |||
284 | 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 | ||
285 | 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). | ||
286 | |||
287 | The next step is to put the WO config file into the right location: | ||
288 | |||
289 | {{code}} | ||
290 | |||
291 | cp webobjects.conf /etc/apache2/ | ||
292 | |||
293 | {{/code}} | ||
294 | |||
295 | That config file has been altered in three ways: | ||
296 | |||
297 | * the LoadModule directive is commented out as it was automatically added to the main config file by apxs | ||
298 | * the WebObjectsDocumentRoot points to the standard apache2 location /var/apache2/htdocs | ||
299 | Change it if you have moved your htdocs to another place | ||
300 | * the WebObjectsAlias has been changed to /Apps/WebObjects | ||
301 | 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. | ||
302 | |||
303 | Then lastly add as the last line of your current apache configuration file: | ||
304 | |||
305 | {{code}} | ||
306 | |||
307 | Include /etc/apache2/webobjects.conf | ||
308 | |||
309 | {{/code}} | ||
310 | |||
311 | **Please note that I don't guarantee that this adaptor works as intended. Use only at your own risk.** | ||
312 | |||
313 | = Running Apache = | ||
314 | |||
315 | The very last step is to start apache. On Solaris use the command: | ||
316 | |||
317 | {{code}} | ||
318 | |||
319 | svcadm enable apache2 | ||
320 | |||
321 | {{/code}} | ||
322 | |||
323 | And check if it is really running | ||
324 | |||
325 | {{code}} | ||
326 | |||
327 | svcs -x apache2 | ||
328 | |||
329 | {{/code}} | ||
330 | |||
331 | (% class="auto-cursor-target" %) | ||
332 | \\ |