Wiki source code of Deploying on Linux

Last modified by Samuel Pelletier on 2022/02/11 21:35

Hide last authors
Ray Kiddy 286.1 1 (% class="auto-cursor-target" %)
2 \\
3
Pascal Robert 274.1 4 {{warning}}
Samuel Pelletier 292.1 5 If you are using RedHat Enterprise Linux, CentOS or Amazon Linux, stop right there! We now have RPM packages for CentOS and RedHat 5.x/6.x, and Amazon Linux. [[Read the following instructions>>doc:documentation.Home.Deployment.Platforms.Installing a deployment environment on RedHat, CentOS or Amazon Linux.WebHome]] instead of this document.
Pascal Robert 274.1 6
D Tim Cummings 291.1 7 Guess what? If you are using Debian or Ubuntu, [[packages>>doc:documentation.Home.Deployment.Platforms.Installing a deployment environment on Debian or Ubuntu releases from 2008 to 2016.WebHome]] are also available for your platform (although not yet for Xenial)!
Pascal Robert 274.1 8 {{/warning}}
9
Ray Kiddy 289.1 10 === Install Sun Java JDK ===
Kieran Kelleher 202.1 11
mrxinu 280.1 12 ~1. You should install a [[Sun/Oracle Java SDK>>url:http://www.oracle.com/technetwork/java/javase/downloads/index.html||shape="rect"]]. Use Oracle's [[installation instructions>>url:http://www.oracle.com/technetwork/java/javase/index-137561.html#linux||shape="rect"]]. Choose the appropriate 32-bit or 64-bit Linux installer, for example jdk-6u27-linux-x64-rpm.bin, and install it.
pyu 228.1 13
14 {{warning}}
mrxinu 280.1 15 Make sure to install the correct "bit" version for the OS, e.g. install 64 bit JVM on a 64 bit installation, and a 32 bit JVM on a 32 bit installation! To find that information, do:
pyu 228.1 16
mrxinu 280.1 17 {{code}}
18 uname -p
19 {{/code}}
20
21 If the response is //x86_64//, it's a 64 bit system. If the response is //i386// or //i686//, it's a 32 bit system.
pyu 228.1 22 {{/warning}}
23
Pascal Robert 216.1 24 Creating symbolic links as follows is useful (alternatively use the 'alternatives' command to manage JVMs):
25
Maik Musall 92.1 26 {{code}}
Ray Kiddy 287.1 27 ln -s /usr/java/jdk1.6.0_27 /usr/java/jdk1.6
28 ln -s /usr/java/jdk1.6/bin/java /usr/bin/java
Kieran Kelleher 176.1 29 {{/code}}
30
mrxinu 280.1 31 and you need to change your path in your bash profile (_~~/.bash_profile) to have this path :
Kieran Kelleher 176.1 32
33 {{code}}
Pascal Robert 216.1 34 PATH=$PATH:/usr/java/jdk1.6/bin:$HOME/bin
Kieran Kelleher 176.1 35 {{/code}}
36
Ray Kiddy 289.1 37 === Install the WebObjects frameworks (Optional) ===
Kieran Kelleher 202.1 38
Pascal Robert 272.1 39 {{info}}
40 If you embed the frameworks into your applications, you don't need to install the core frameworks on the deployment system. Install them only if your applications don't have the frameworks inside their bundles.
41 {{/info}}
42
Pascal Robert 234.1 43 2. Get the WebObjects installer from the wocommunity's Web site :
Kieran Kelleher 176.1 44
45 {{code}}
Ray Kiddy 288.1 46 curl -C - -O https://jenkins.wocommunity.org/job/WOInstaller/lastSuccessfulBuild/artifact/Utilities/WOInstall/WOInstaller.jar
47
48 OR
49
50 wget https://jenkins.wocommunity.org/job/WOInstaller/lastSuccessfulBuild/artifact/Utilities/WOInstall/WOInstaller.jar
Ray Kiddy 286.1 51 {{/code}}
jlittle 204.1 52
Ray Kiddy 286.1 53 and install it like this :
jlittle 204.1 54
Kieran Kelleher 176.1 55
Ray Kiddy 286.1 56 [[https:~~/~~/download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mac_OS_X/downloads/061-4634.20080915.3ijd0/WebObjects543.dmg>>url:https://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mac_OS_X/downloads/061-4634.20080915.3ijd0/WebObjects543.dmg||shape="rect"]]\\
Kieran Kelleher 176.1 57
Ray Kiddy 286.1 58 {{{ wget sudo java -jar WOInstaller.jar dev54 /opt}}}
Kieran Kelleher 176.1 59
Ray Kiddy 286.1 60 You may see an error as the command above finishes, but WO may still be installed.
Kieran Kelleher 176.1 61
Ray Kiddy 286.1 62 This command below is what you could do if you did not need the dmg above. Unfortunately there is a bug having to do with downloading via HTTPS and you do not get the WebObjects543.dmg automatically and you need the command above.
Kieran Kelleher 176.1 63
Ray Kiddy 286.1 64 \\
Kieran Kelleher 176.1 65
Ray Kiddy 286.1 66
Bastian Triller 290.1 67
68 ///opt
Ray Kiddy 286.1 69 \\//
70
71 {{{ sudo /usr/java/latest/bin/java -jar WOInstaller.jar 5.4.3 /optWebObjects frameworks are now installed in }}}
72
Kieran Kelleher 176.1 73 {{code}}
Ray Kiddy 287.1 74 [root@ ~]# ls -l /opt
75 total 12
76 drwxr-xr-x 3 root root 4096 Nov 9 08:19 Developer
77 drwxr-xr-x 4 root root 4096 Nov 9 08:19 Library
78 drwxr-xr-x 3 root root 4096 Nov 9 08:20 Local
Kieran Kelleher 176.1 79 {{/code}}
Maik Musall 92.1 80
Ray Kiddy 289.1 81 === Creating the //appserver// user and starting wotaskd/JavaMonitor ===
Pascal Robert 272.1 82
Maik Musall 236.1 83 To follow the conventions from Mac OS X, we will create two users to run wotaskd and Monitor under this user :
David LeBer 184.1 84
85 {{code}}
Ray Kiddy 287.1 86 sudo groupadd appserveradm
87 sudo useradd -g appserveradm appserver
David LeBer 184.1 88 {{/code}}
89
Maik Musall 236.1 90 Edit the bash profile of the appserver
91
92 {{code}}
Ray Kiddy 287.1 93 # sudo su - appserver
94 % vi .bash_profile
Maik Musall 236.1 95 {{/code}}
96
97 and add this line :
98
99 {{code}}
Pascal Robert 250.1 100 export NEXT_ROOT=/opt
Maik Musall 236.1 101 {{/code}}
102
Pascal Robert 216.1 103 and run it manually in your current shell :
David LeBer 184.1 104
105 {{code}}
Pascal Robert 250.1 106 [appserver@ ~]$ . .bash_profile
David LeBer 184.1 107 {{/code}}
108
Pascal Robert 232.1 109 3. Next, we need to install the Wonder version **wotaskd** and **JavaMonitor**.
Pascal Robert 174.1 110
Kieran Kelleher 176.1 111 {{code}}
Ray Kiddy 287.1 112 $ mkdir -p /opt/Local/Library/WebObjects/JavaApplications
113 $ cd /opt/Local/Library/WebObjects/JavaApplications
114 $ wget https://jenkins.wocommunity.org/job/Wonder7/lastSuccessfulBuild/artifact/Root/Roots/wotaskd.tar.gz
115 $ tar zpxf wotaskd.tar.gz
116 $ rm wotaskd.tar.gz
117 $ wget https://jenkins.wocommunity.org/job/Wonder7/lastSuccessfulBuild/artifact/Root/Roots/JavaMonitor.tar.gz
118 $ tar zpxf JavaMonitor.tar.gz
119 $ rm JavaMonitor.tar.gz
Pascal Robert 232.1 120 {{/code}}
121
Maik Musall 236.1 122 4. Now we need to change some permissions:
Pascal Robert 232.1 123
124 {{code}}
Ray Kiddy 287.1 125 sudo chown -R appserver:appserveradm /opt/Local
126 sudo chown -R appserver:appserveradm /opt/Library
Kieran Kelleher 176.1 127 {{/code}}
128
Pascal Robert 232.1 129 5. Now we can start wotask and Monitor
Pascal Robert 216.1 130
131 {{code}}
Pascal Robert 272.1 132 [root@ ~]# sudo su - appserver
Pascal Robert 216.1 133 {{/code}}
134
Ray Kiddy 289.1 135 You can start wotaskd and Monitor, manually, to make sure that they run without any problems :
Kieran Kelleher 176.1 136
137 {{code}}
Ray Kiddy 287.1 138 [appserver@ ~]$ $NEXT_ROOT/Local/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd &
139 [appserver@ ~]$ $NEXT_ROOT/Local/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &
Kieran Kelleher 176.1 140 {{/code}}
141
Ray Kiddy 289.1 142 === Apache ===
Kieran Kelleher 202.1 143
Ray Kiddy 289.1 144 //(Should info on properly installing and configuring Apache be its own page? Is it its own page somewhere else already? -rrk)//
145
Pascal Robert 274.1 146 If your Linux installation don't already have Apache httpd running or installed, you need to install it:
David LeBer 184.1 147
Ray Kiddy 286.1 148 For Ubuntu distributions :
David LeBer 184.1 149
Kieran Kelleher 176.1 150 {{code}}
David LeBer 184.1 151 sudo apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils apache2-threaded-dev ssl-cert
Kieran Kelleher 176.1 152 {{/code}}
153
David LeBer 184.1 154 On that system the relevant command names are //apache2ctl// and //apxs2//, and the document root is ///var/www// (not ///usr/local/apache/htdocs// as in the example below).
Kieran Kelleher 176.1 155
David LeBer 184.1 156 (you will need httpd-devel and gcc)
157
Ray Kiddy 286.1 158 For CentOS, RedHat or Fedora distributions :
jlittle 204.1 159
Pascal Robert 216.1 160 {{code}}
Ray Kiddy 286.1 161 I found on AWS for apache 2.4 I had to change the yum to: yum install httpd24 httpd24-devel   yum install httpd mod_ssl httpd-devel chkconfig httpd on /etc/init.d/httpd start
Pascal Robert 216.1 162 {{/code}}
163
jlittle 204.1 164 .. default install location is then /etc/httpd
165
Ray Kiddy 289.1 166 === HTTP Adaptor ===
Kieran Kelleher 202.1 167
mrxinu 280.1 168 First, check if a pre-built module already exists at [[wocommunity.org>>url:http://wocommunity.org/documents/tools/mod_WebObjects/||shape="rect"]]. If you are running CentOS 6.x, you can use the module for CentOS 5.5, it works fine.
Pascal Robert 216.1 169
Pascal Robert 272.1 170 Once you have downloaded the module, you can install it with:
Pascal Robert 232.1 171
Pascal Robert 244.1 172 {{code}}
Pascal Robert 272.1 173 sudo apxs -i -a -n WebObjects mod_WebObjects.so
Pascal Robert 244.1 174 {{/code}}
175
Bastian Triller 290.1 176 If you can't find a adaptor for your Linux platform, you [[will have to build it>>doc:documentation.Home.Deployment.Compiling the HTTP adaptor on Linux.WebHome]]
Maik Musall 252.1 177
Ray Kiddy 289.1 178 === Apache Configuration ===
Kieran Kelleher 202.1 179
mrxinu 280.1 180 Instead of copying the //WebObjects// directory, you can use a alias to point to the folder inside NEXT_ROOT. In your Apache configuration, add something like :
Kieran Kelleher 176.1 181
182 {{code}}
183 Alias /WebObjects "/opt/Local/Library/WebServer/Documents/WebObjects"
184 {{/code}}
185
186 and add a directive to allow fetching files in this directory:
187
188 {{code}}
Ray Kiddy 286.1 189 <Directory "/opt/Local/Library/WebServer/Documents/WebObjects"> AllowOverride All Order allow,deny Allow from all </Directory>
Kieran Kelleher 176.1 190 {{/code}}
191
David LeBer 184.1 192 Or (depending on your Apache configuration) you could use a symbolic link.
193
Kieran Kelleher 176.1 194 You also need, as explained by the adaptor's README file, to add this directive in //httpd.conf// :
195
196 {{code}}
Ray Kiddy 286.1 197 <LocationMatch /apps/WebObjects/.*> Order allow,deny Allow from all </LocationMatch>
Kieran Kelleher 176.1 198 {{/code}}
199
David LeBer 184.1 200 If you don't add it, you will get 403s (Forbidden) HTTP errors.
Kieran Kelleher 176.1 201
202 If you want to keep ///cgi-bin/WebObjects// as the base URL, you will need to remove a line in //httpd.conf//. Find the line that starts with //ScriptAlias /cgi-bin// and comment it out, or else Apache will try to find a //WebObjects// CGI in ///cgi-bin// instead of loading the adaptor from the Apache module.
203
mrxinu 280.1 204 And edit ///usr/local/apache/conf/extra/webobjects.conf// to comment the //LoadModule WebObjects_module// line. You can also change the //WebObjectsAlias// property, in my case I use ///apps/WebObjects//. Last step : add the following line in httpd.conf (near the end):
Kieran Kelleher 176.1 205
206 {{code}}
207 Include conf/extra/webobjects.conf
208 {{/code}}
209
210 Check for any errors with //apachectl configtest//, and if everything's ok, you are good to go. You can install your first app, don't forget that your app must be accessible by the //appserver// user or the //appserveradm// group. If your app don't start or if Monitor complains about a path, it might be a permission problem.
211
212 Jerome Chan told me that you can check if the Apache module is loaded by doing this :
213
214 {{code}}
215 /usr/local/apache/bin/apachectl -M
216 {{/code}}
217
Pascal Robert 216.1 218 On my installation on OpenSuse 11.1, I had to change the path to the lib64 directory where Apache contains the modules.
219
220 {{code}}
221 LoadModule WebObjects_module /usr/lib64/apache2/mod_WebObjects.so
222 {{/code}}
223
Ray Kiddy 289.1 224 === Auto Start WOTaskd and WOMonitor ===
Kieran Kelleher 202.1 225
Pascal Robert 272.1 226 One last thing, you need a init script to start wotaskd and Monitor at boot time.
Kieran Kelleher 176.1 227
Ray Kiddy 289.1 228 The scripts are [[available>>url:https://github.com/wocommunity/wonder/tree/integration/Utilities/Linux/StartupScripts/RedHat||shape="rect"]] on GitHub. Grab the two files (//womonitor// and //wotaskd//) and copy them into the proper directory.
Kieran Kelleher 176.1 229
Ray Kiddy 289.1 230 You will be able to see where the services files should go by searching for others.
Kieran Kelleher 176.1 231
Pascal Robert 272.1 232 {{code}}
Ray Kiddy 289.1 233 find /etc /lib -name \*.service
Pascal Robert 272.1 234 {{/code}}
Kieran Kelleher 176.1 235
Ray Kiddy 289.1 236 Once a wotaskd.service and womonitor.servcie file are in the proper location, you can start them:
Ray Kiddy 286.1 237
mrxinu 280.1 238 {{code}}
Ray Kiddy 289.1 239 sudo service start wotaskd
240 sudo service start womonitor
Ray Kiddy 286.1 241 {{/code}}
Kieran Kelleher 176.1 242
Ray Kiddy 286.1 243 (% class="auto-cursor-target" %)
Ray Kiddy 289.1 244 You should be deploying as the user "appserver" and, if you have done this, make sure that all files and directories referred to in the service files exist and that the permissions are as they should be and that they are owned by or accessible to the appserver user. All files must be readable, all directories must be readable and executable and scripts must the executable. Make sure to check log file locations as well.
Kieran Kelleher 176.1 245
Ray Kiddy 289.1 246 (% class="auto-cursor-target" %)
247 Any errors in these files may make the service fail to start in non-obvious ways. The resulting error messages may not be helpful. The best strategy is to be very careful with the contents of the files. An example service file is below. Running "systemctl status" on the services and carefully examining everything in the output may help you with deployment problems.
Kieran Kelleher 176.1 248
Ray Kiddy 286.1 249 (% class="auto-cursor-target" %)
Ray Kiddy 289.1 250 Enabling the services will ensure that the services restart after a reboot.
Ray Kiddy 286.1 251
mrxinu 280.1 252 {{code}}
Ray Kiddy 289.1 253 sudo service enable wotaskd
254 sudo service enable womonitor
Ray Kiddy 286.1 255 {{/code}}
Pascal Robert 216.1 256
Ray Kiddy 286.1 257 \\
Pascal Robert 216.1 258
Maik Musall 284.1 259 Here's a systemd unit to put into {{code language="none"}}/lib/systemd/system/wotaskd.service{{/code}}
260
261 {{code}}
Ray Kiddy 287.1 262 # systemd unit for wotaskd to run on Ubuntu 16.04 LTS
263 # Maik Musall <maik@selbstdenker.ag>, Aug 2016 [Unit]
264 Description=WebObjects/Wonder wotaskd
265 Documentation=https://wiki.wocommunity.org/display/documentation/Wonder+JavaMonitor+and+wotaskd
266 AssertPathExists=/var/log/webobjects
267 AssertPathExists=/opt/Local/Library/WebObjects/JavaApplications/wotaskd.woa
268 [Service]
269 User=appserver
270 Group=appserveradm
271 Environment=NEXT_ROOT=/opt
272 Environment="JVM_OPTIONS=-Xms32m -Xmx64m -XX:NewSize=2m"
273 Environment=WOTASKD_LOG=/var/log/webobjects/wotaskd.log
274 ExecStart=/opt/Local/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd -WOPort 1085 -Xms32m -Xmx64m >> $WOTASKD_LOG 2>&1 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target
Maik Musall 284.1 275 {{/code}}
276
Ray Kiddy 289.1 277 \\
Maik Musall 284.1 278
Ray Kiddy 289.1 279 === Problems with Application Responding to WOMonitor/WOTaskd ===
Maik Musall 284.1 280
Pascal Robert 234.1 281 If your Linux server is a virtual machine or if it has multiple IP addresses, you may find that clicking 'Stop' in WOMonitor has no effect on instances, or that the applications never start (the level just go up and down non-stop). This can usually be solved for all Wonder-based applications running on hosts with such a problem by simply creating the following file (known as the 'Machine Properties' file in Wonder's ERXProperties):
Pascal Robert 216.1 282
283 {{code}}
284 /etc/WebObjects/Properties
285 {{/code}}
286
287 And inside that file, add an array property that defines all the IP addresses assigned to your host, for example:
288
289 {{code}}
290 er.extensions.WOHostUtilities.localhostips=(192.168.3.168,192.168.1.168)
291 {{/code}}
292
Ray Kiddy 286.1 293 (% class="auto-cursor-target" %)
294 \\
295
Pascal Robert 216.1 296 {{info}}
297 To learn more, see the class named WOHostUtilities in ERExtensions framework
298 {{/info}}
299
Ray Kiddy 286.1 300 SELinux
jlittle 204.1 301
mrxinu 280.1 302 If SELinux is enabled on your system, wotaskd won't be reachable due to its preventing Apache from opening TCP connections. If you're comfortable with allowing Apache to connect to any TCP ports (including external hosts), you can run the following:
jlittle 204.1 303
304 {{code}}
305 sudo setsebool -P httpd_can_network_connect=1
306 {{/code}}
307
mrxinu 280.1 308 Alternatively, [[Steven Klassen>>url:http://www.mrxinu.com/||shape="rect"]] has written a blog post ([[Custom SELinux Port Access>>url:http://www.mrxinu.com/2013/06/07/custom-selinux-port-access/||shape="rect"]]) that outlines how to create and install a wotaskd SELinux module that specifically allows connections to port 1085.
309
Pascal Robert 272.1 310 {{warning}}
mrxinu 280.1 311 Be aware that SELinux is enabled by default on CentOS 6.x, you will need to either call the //setsebool// command or to [[disable SELinux>>url:http://www.how2centos.com/disable-selinux-centos-6/||shape="rect"]]
Pascal Robert 272.1 312 {{/warning}}
313
Ray Kiddy 286.1 314 Additional Resources
Kieran Kelleher 198.1 315
mrxinu 280.1 316 [[Jonathon Rentzsch WOPlat Project 'WOInstaller + Wonder Web Server Adaptor + OS Support Files'>>url:http://github.com/rentzsch/woplat||shape="rect"]]
Ray Kiddy 286.1 317 [[http:~~/~~/vmadmin.nt.com.au/?p=47>>url:http://vmadmin.nt.com.au/?p=47||shape="rect"]]
318 [[http:~~/~~/www.watermarkstudios.com/blog/?p=48>>url:http://www.watermarkstudios.com/blog/?p=48||shape="rect"]]