Replacing web site content with fresh version from JWS2 (JABAWS production ) branch
[jabaws.git] / website / man_serverwar.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml">\r
4 <head>\r
5 <meta name="Last-modified" content="Mon, 11 Dec 2010 01:03:33 GMT"/>\r
6 <title>Java Bioinformatics Analyses Web Services (JABAWS) Server Web Aplication aRchive manual</title>\r
7 <link href="ws.css" rel="stylesheet" type="text/css" media=\r
8 "screen, projection, handheld, tv" />\r
9 <link rel="stylesheet" type="text/css" media="print" href=\r
10 "print.css" />\r
11 <script type="text/javascript" src="prototype-1.6.0.3.js"></script>\r
12 </head>\r
13 <body>\r
14 <div id="page">\r
15 <div id="banner">\r
16 <table> \r
17 <tr><td style="width:130px;"><a href="http://www.dundee.ac.uk"><img class="logo" src="images/uod_lt.gif"  alt="University of Dundee"  title="University of Dundee" longdesc="http://www.dundee.ac.uk"/></a></td>\r
18 <td class="bg"><h1><span class="headeru">JA</span>va <span class=\r
19 "headeru">B</span>ioinformatics <span class="headeru">A</span>nalysis <span class="headeru">W</span>eb <span\r
20 class="headeru">S</span>ervices</h1></td>\r
21 </tr>\r
22 </table></div><!-- banner end-->\r
23 \r
24 <div id="wrapper">\r
25 <div id="panel"><a href="index.html">Home</a> \r
26     <a class="selected" href="manual.html">Manual</a> \r
27         <div id="submenu">\r
28                 <a href="manual.html">Quick Start Guide</a>\r
29                 <a href="man_about.html">About</a>\r
30                 <a href="man_servervm.html" title="JABAWS Server as Virtual Appliance">Server VA</a>\r
31                 <a class="selected" href="man_serverwar.html" title="JABAWS Server as Web Application aRchive">Server WAR</a>\r
32                 <a href="man_configuration.html" >Server<br/>\r
33                 Configuration</a>\r
34                 <a href="man_client.html" title="JABAWS Command Line Client">CMD Client</a>\r
35                 <a href="man_dev.html" title="Accessing JABAWS from your program">Accessing<br/>\r
36                 JABAWS</a>      \r
37         </div>\r
38 <a href="download.html">Download</a> \r
39 <a href="http://www.compbio.dundee.ac.uk">Barton Group</a> \r
40 </div>\r
41 \r
42 <!-- panel end-->\r
43 <div id="content">\r
44 <h2 id="headtitle">JABAWS MANUAL</h2>\r
45 \r
46 <h2>JABAWS Server Web Application aRchive (WAR) </h2>\r
47 <ul>\r
48   <li><a href="#sysreq">System Requirements</a></li>\r
49   <li><a href="#instwar">Installing the JABAWS WAR file</a></li>\r
50   <li><a href="#prepexec">Preparing executables for use with JABAWS</a></li>\r
51   <li><a href="#useprebin">Using the pre-compiled i386 binaries on Linux</a></li>\r
52   <li><a href="#recompbinaries">Recompiling the bundled\r
53     programs for your system</a></li>\r
54   <li><a href="#haveexec">Reuse the binaries that are\r
55     already in your system</a></li>\r
56   <li><a href="#obtainexec">Obtaining alignment\r
57     programs for your operating system</a></li>\r
58   <li><a href="#usingWsTester">Testing JABAWS Server</a></li>\r
59   <li><a href="#diffcontexts">Running many JABAWS instances on the same server</a> </li>\r
60   <li><a href="#nocluster">JABAWS on a single server</a></li>\r
61   <li><a href="#clustsubsys">JABAWS supported cluster batch management systems </a></li>\r
62   <li><a href="#tomstopundeploy">Manually deploying JABAWS application on Apache-Tomcat </a></li>\r
63 </ul>\r
64 <p><strong>Troubleshooting</strong></p>\r
65 <ul>\r
66   <li><a href="#tomdeploy">Apache-Tomcat fails to deploy the jabaws.war file</a></li>\r
67   </ul>\r
68 <h3><a name="sysreq" id="sysreq"></a>System Requirements</h3>\r
69 <p>JABAWS requires a Java web application server compliant with\r
70 version 2.4 of the Java Servlet specification, and a Java 6 runtime\r
71 environment. We recommend using an official Oracle Java 6 runtime\r
72 environment, and <a\r
73 href="http://tomcat.apache.org/download-60.cgi">Apache-Tomcat</a> web application server version 6, but other versions may work as well. </p>\r
74 \r
75 <p>JABAWS Web Application aRchive can run on any host operating system that supports Java. However JABAWS depends on the third party programs which are not available for all operating systems. In particular, only Clustal and Muscle are currently available for MS Windows platform.\r
76   <!-- todo: link to help about obtaining and installing tomcat -->\r
77 </p>\r
78 <p>JABAWS comes with pre-compiled MS Windows and Linux IA32 binaries and contains all the binaries sources.</p>\r
79 <p>To run JABAWS on the cluster you must have shared disk space accessible from all cluster nodes. </p>\r
80 <h3><a name="instwar" id="instwar"></a>Installing the JABAWS WAR file</h3>\r
81 <p>JABAWS is distributed as a web application archive (WAR). To\r
82 deploy JABAWS in Apache-Tomcat - simply drop the war file into the\r
83 <span class="highlight">webapps</span> directory of a running\r
84 Tomcat, and it will do the rest. If you used this deployment procedure, <span class="attention">do not remove</span> jabaws war file, otherwise Tomcat will undeploy your application!  </p>\r
85 <p>For any other web application\r
86   server, please follow your server's specific deployment procedure\r
87   for 'WAR' files. If you install JABAWS on a MS Windows machine, then\r
88   at this point your JABAWS installation will already be up and\r
89   running, and you can try its services out <a href=\r
90 "#usingWsTester">as described here</a>. If you install JABAWS on Linux you will need to set an executable flag for binaries. This is described  <a href="#useprebin">here</a>. If your host operating system is different from Windows or Linux then read on. </p>\r
91 <h3><a name="prepexec" id="prepexec"></a>Preparing executables for use with JABAWS</h3>\r
92 \r
93 <p>JABAWS's web services use command line programs to do\r
94 the actual analysis, so it must have access to programs\r
95 which can be executed on your platform. The native executables\r
96 bundled with JABAWS for Windows (32-bit) and Linux (i386, 32-bit) should be\r
97 OK for those systems. The source code for these \r
98 programs is also provided so you can <a href="#recompbinaries">recompile for your own\r
99 architecture</a> and exploit any optimizations that your system can\r
100 provide. Alternately, if you have already got binaries on your\r
101 system, then you can simply <a href="#haveexec">change the paths in JABAWS's\r
102 configuration files</a> so these are used instead.</p>\r
103 \r
104 <h3><a name="useprebin" id="useprebin"></a>Using the pre-compiled i386 binaries on Linux</h3>\r
105 \r
106 <p>Before the binaries that are bundled with JABAWS can be used,\r
107 they must first be made executable using the provided <a name=\r
108 "setexecflag" id="setexecflag">'setexecflag.sh'</a> script:</p>\r
109 \r
110 <ol>\r
111 <li>cd to <span class=\r
112 "hightlight">&lt;webapplicationpath&gt;/binaries/src</span></li>\r
113 \r
114 <li>run <span class="hightlight">sh setexecflag.sh</span></li>\r
115 \r
116 <li>Make sure binaries supplied work under your OS.<br />\r
117  For this run each binary, without any command line options or\r
118 input files. If you see an error message complaining about missing\r
119 libraries or other problems, then you probably need to <a href=\r
120 "#recompbinaries">recompile the binaries</a>. with</li>\r
121 \r
122 <li>Restart the Tomcat.</li>\r
123 </ol>\r
124 \r
125 That's it! JABAWS should work at this point. Try it out using the JABAWS<a\r
126 href="#usingWsTester"> test client</a>. If not,\r
127 read on... or have a look at <a href="http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html">deploying on Tomcat</a> tips.<br />\r
128  <em>Note: You may want to enable logging, <a href="man_configuration.html#logfiles"> as described here</a></em>.<br />\r
129  \r
130 \r
131 <h3><a name="recompbinaries">Recompiling the bundled\r
132 programs for your system</a></h3>\r
133 \r
134 <p>If you have a fully equipped build environment on your\r
135 (POSIX-like) system, then you should be able to recompile the\r
136 programs from the source distributions which are included\r
137 in the JABAWS war file. A script called 'compilebin.sh' is provided\r
138 to automate this task.</p>\r
139 \r
140 <ol>\r
141 <li>In a terminal window, change the working directory to <span\r
142 class="hightlight">binaries/src</span></li>\r
143 \r
144 <li>execute the <span class="highlight">compilebin.sh</span>\r
145 script,<br />\r
146  either use: <span class="hightlight">chmod +x compilebin.sh;\r
147 compilebin.sh &gt; compilebin.out;</span><br />\r
148  or: <span class="hightlight">sh compilebin.sh &gt;\r
149 compilebin.out</span></li>\r
150 \r
151 <li>Now run <span class="hightlight">sh setexecflag.sh</span><br />\r
152  If any of the binaries was not recompiled, then a 'file not found'\r
153 error will be raised.</li>\r
154 \r
155 <li>Finally, restart your Tomcat server (or JABAWS application only), and <a href="#usingWsTester">test JABAWS</a> to\r
156 check that it can use the new binaries.</li>\r
157 </ol>\r
158 \r
159 <p>If you couldn't compile everything, then it may be that your system does\r
160 not have all the tools required for compiling the programs. At the very\r
161 least check that you have gcc, g++ and make installed in your\r
162 system. If not install these packages and repeat the compilation\r
163 steps again. You should also review the compilebin.sh output -\r
164 which was redirected to compilebin.out, and any errors output to\r
165 the terminal. Finally, try obtaining the <a href="#obtainexec">pre\r
166 compiled binaries</a> for your OS.</p>\r
167 \r
168 <h3><a name="haveexec" id="haveexec">Reuse the binaries that are\r
169 already in your system</a></h3>\r
170 \r
171 <p>If you would like to use the binaries you already have then you\r
172 just need to let JABAWS know there they are. To do this, edit:\r
173 <span class="code">conf/Executable.properties</span></p>\r
174 <p>When specifying paths to executables that already exist on your system, make sure you provide an absolute path, or one relative to the JABAWS directory inside <span class="highlight">webapps</span>. For example, the default path for clustalw is defined\r
175 as<span class=\r
176 "code">local.clustalw.bin=binaries/src/clustalw/src/clustalw2</span>\r
177 Alternatively, instead of changing <span class=\r
178 "hightlight">Executable.properties</span> you could also replace\r
179 the executables bundled with JABAWS with the ones that you have, or make symbolic links to them.\r
180 Then the default configuration will work for you. More information\r
181 about <span class="hightlight">the\r
182 Executable.properties</span> file is given in the <a href="man_configuration.html#exec">JABAWS Configuration chapter.</a></p>\r
183 \r
184 <h3><a name="obtainexec" id="obtainexec">Obtaining alignment\r
185 programs for your operating system</a></h3>\r
186 \r
187 <p>You could search for pre-packaged compiled executable in your\r
188 system package repository or alternately, download pre-compiled\r
189 binaries from each alignment program's home page. Then, either\r
190 replace the executables supplied with the downloaded ones, or\r
191 modify the paths in <span class=\r
192 "hightlight">executable.properties</span> as described above. Below are some suggestions on where you may be able to get the binaries for your system. </p>\r
193 <ul>\r
194   <li><a href="ftp://ftp.ebi.ac.uk/pub/software/clustalw2/2.0.12/">ClustalW</a></li>\r
195   <li><a href="http://mafft.cbrc.jp/alignment/software/">Mafft</a></li>\r
196   <li><a href="http://www.drive5.com/muscle/download3.6.html">Muscle</a></li>\r
197   <li><a href="http://www.tcoffee.org/Packages/Binaries/">Tcoffee</a></li>\r
198   <li>Probcons (Linux <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linuxI386/probcons/">I386</a> | <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linuxAMD64/probcons/">AMD64</a>)</li>\r
199 </ul>\r
200 <h3><a name="usingWsTester" id="usingWsTester"></a>Testing JABAWS Server </h3>\r
201 <p>First of all make sure that Tomcat server is started successfully. If this was the case, then you should see JABAWS home page when you navigate to your Tomcat JABAWS context path e.g. <span class="code">http://myhost.compbio.ac.uk:8080/jabaws</span>If you see it, then it is time to make sure that web services are working too. Assuming that you have unpacked/deployed JABAWS from the server war file, you should be able to navigate to the test program which can be found in &lt;webapplicationpath&gt;/WEB-INF/lib/jabaws-client.jar file. To run the tests type:<span class="code"> java -jar jabaws-client.jar -h=&lt;Your web application server host name, port and JABAWS context path&gt;</span></p>\r
202 <p>For example to test all JABAWS web services on host myhost.compbio.ac.uk type: </p>\r
203 <p class="code">java -jar jabaws-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws </p>\r
204 <p>You can choose a particular web server using -s option like this <span class="code">java -jar jabaws-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws -s=ClustalWS </span>This command line assumes that java executable is in your path and jabaws-client.jar is located in the current directory.</p>\r
205 <p>An example of the report testing tool produces for operating web service looks like this: </p>\r
206 <p><span class="code"> Connecting to service MuscleWS on http://myhost.compbio.ac.uk:8080/jabaws ... OK<br />\r
207   Testing alignment with default parameters:<br />\r
208   Queering job status...OK<br />\r
209   Retrieving results...OK<br />\r
210   Testing alignment with presets:<br />\r
211   Aligning with preset 'Protein alignment(Fastest speed)'... OK<br />\r
212   Aligning with preset 'Nucleotide alignment(Fastest speed)'... OK<br />\r
213   Aligning with preset 'Huge alignments (speed-oriented)'... OK<br />\r
214   Queering presets...OK<br />\r
215   Queering Parameters...OK<br />\r
216   Queering Limits...OK<br />\r
217   Queering Local Engine Limits...OK<br />\r
218   Check is completed service MuscleWS IS WORKING</span>An example of the response of a web service which is deployed but is not operating is below: </p>\r
219 <p><span class="code">Connecting to service ProbconsWS on http://localhost:8080/ws ... OK<br />\r
220   Testing alignment with default parameters:FAILED<br />\r
221   Service ProbconsWS IS NOT FUNCTIONAL</span>If the web server did not respond the message looks like following: <span class="code">Connecting to service TcoffeeWS on http://localhost:8080/ws ... FAILED</span></p>\r
222 <h3><a name="diffcontexts" id="diffcontexts"/></a></a>Running many JABAWS instances on the same server</h3>\r
223 <p> JABAWS is supplied as a Web Application aRchive which can be dealt with as any other web applications. So it is perfectly possible to run two JABAWS instances from the same server. Just make two different contexts on your application server and unpack JABAWS in both of them. For example if your server name is http://www.align.ac.uk, and the context names are public and private. Than one group of users could be given a URL http://www.align.ac.uk/public and another http://www.align.ac.uk/private. These contexts will be served by two independent JABAWS instances, and could be configured differently. If you keep local engine enabled, make sure you reduce the number of threads local engine is allowed to use to avoid overloading the server. Alternatively two completely separate web application server instances (e.g. Apache-Tomcat) could be used. This will give you a better resilience and more flexibility in memory settings. </p>\r
224 <h3><a name="nocluster" id="nocluster"></a>JABAWS on a single server</h3>\r
225 <p>You can run  JABAWS on a single server. Obviously the capacity will be limited, but may be sufficient for a small lab. Installed on a single server, JABAWS executes tasks in parallel, so the more cores the server has the more requests it will be able to handle. </p>\r
226 <h3><a name="clustsubsys" id="clustsubsys"></a>JABAWS supported cluster batch management systems </h3>\r
227 <p>JABAWS uses <a href="http://drmaa.org/">DRMAA</a> v. 1.0 library to send and manage jobs on the cluster. DRMAA supports many different cluster job management systems. Namely Sun Grid Engine, Condor, PBS, GridWay, Globus 2/4, PBSPro, LSF. For up to date information please consult DRMAA web site. We found that DRMAA implementation differ from platform to platform and were trying to use only the basic functions. We have only tested JABAWS on Sun Grid Engine v 6.2. Please let use know if you have any experience of running JABAWS on other platforms.</p>\r
228 <h3><a name="tomstopundeploy" id="tomstopundeploy"></a>Manually deploying JABAWS application on Apache-Tomcat </h3>\r
229 <p>To stop Tomcat from automatically undeploying your application if the war file is removed use an explicit application descriptor. It could come in different flavors, the one I prefer if to drop a context descriptor file into <span class="hightlight">&lt;tomcatRoot&gt;conf/Catalina/localhost</span> directory. Name your context file the same as your application folder e.g. if you JABAWS resides in webappl/jabaws folder, then call the context file jabaws.xml. Below is an example of content this file might have.</p>\r
230 <p class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />\r
231   &lt;Context antiResourceLocking=&quot;false&quot; privileged=&quot;true&quot;  /&gt;</p>\r
232 <p>This should be sufficient to prevent Tomcat from removing your JABAWS from WEBAPPS. For more information about the Tomcat deployer <a href="http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html">read this documentation on the Apache-Tomcat web site</a>.</p>\r
233 <h3><a name="tomdeploy" id="tomdeploy"></a>Apache-Tomcat fails to deploy jaba.war file </h3>\r
234 <ul>\r
235   <li>Make sure Tomcat have sufficient access rights to read your war file. </li>\r
236   <li>Restart the Tomcat, sometimes it will not since that the new war file is added without restart</li>\r
237   <li>If Tomcat still refuses to unpack the war file, unpack it manually into web application folder (the war file is just a zip archive). <a href="manual.html#setexecflag"> </a> Restart the Tomcat.</li>\r
238 </ul>\r
239 </div>\r
240 \r
241 <!-- content end-->\r
242 <div id="copyright">Last update: 7 January 2011<br />\r
243  Peter Troshin, Jim Procter and Geoff Barton, The Barton Group, University of\r
244 Dundee, UK</div>\r
245 </div>\r
246 \r
247 <!-- wrapper end-->\r
248 </div>\r
249 <!-- page end-->\r
250 \r
251 <!-- Google analitics -->\r
252 <script type="text/javascript">\r
253 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");\r
254 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));\r
255 </script>\r
256 <script type="text/javascript">\r
257 try{\r
258 var pageTracker = _gat._getTracker("UA-5356328-1");\r
259 pageTracker._trackPageview();\r
260 } catch(err) {}\r
261 </script>\r
262 </body>\r
263 </html>\r
264 \r