Adding new web service, getting rid of virtual box in docs
[jabaws.git] / website / man_serverwar.html
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE html PUBLIC "XHTML 1.0 Strict"\r
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
4 <html xmlns="http://www.w3.org/1999/xhtml">\r
5 <head>\r
6 <meta name="Last-modified" content="Mon, 4 Apr 2011 12:00:00 GMT"/>\r
7 <title>Java Bioinformatics Analyses Web Services (JABAWS) Server Web Aplication aRchive manual</title>\r
8 <link href="ws.css" rel="stylesheet" type="text/css" media=\r
9 "screen, projection, handheld, tv" />\r
10 <link rel="stylesheet" type="text/css" media="print" href=\r
11 "print.css" />\r
12 <script type="text/javascript" src="prototype-1.6.0.3.js"></script>\r
13 </head>\r
14 <body>\r
15 <div id="page">\r
16 <div id="banner">\r
17 <table> \r
18 <tr><td style="width:158px;"><a href="http://www.dundee.ac.uk"><img src="images/uod_lt_long.gif"  alt="University of Dundee" width="158" height="90" class="logo"  title="University of Dundee" longdesc="http://www.dundee.ac.uk"/></a></td>\r
19 <td class="bg"><img src="images/jabaws2.png" alt="JABAWS-2.0:Disorder" width="353" height="67" title="JABAWS-2.0:Disorder"/></td>\r
20 <td class="bg"><img src="images/banner_right.png" alt="Disorder" width="200" height="80"/></td>\r
21 </tr>\r
22 </table>\r
23 </div><!-- banner end-->\r
24 \r
25 <div id="wrapper">\r
26 <div id="panel"><a href="index.html">Home</a> \r
27          <a href="quick_start.html">Getting Started</a> \r
28     <a class="selected" href="man_about.html">Manual</a> \r
29         <div id="submenu">\r
30                 <a href="man_about.html">About</a>\r
31                 <a href="man_servervm.html" title="JABAWS Server as Virtual Appliance">Server VA</a>\r
32                 <a class="selected" href="man_serverwar.html" title="JABAWS Server as Web Application aRchive">Server WAR</a>\r
33                 <a href="man_configuration.html" >Server<br/>\r
34                 Configuration</a>\r
35                 <a href="man_client.html" title="JABAWS Command Line Client">CMD Client</a>\r
36                 <a href="man_stats.html" title="JABAWS Usage Statistics">Usage Statistics</a>\r
37                 <a href="man_dev.html" title="Accessing JABAWS from your program">Accessing<br/>\r
38                 JABAWS</a>      \r
39                 <a href="man_server_dev.html" >JABAWS Development</a>\r
40         </div>\r
41 <a href="download.html">Download</a> \r
42 <a href="contacts.html">Contact Us</a>\r
43 <a href="PublicAnnualStat" title="JABAWS server usage statistics">Usage Statistics</a>\r
44 <a href="http://www.compbio.dundee.ac.uk" title="University of Dundee, The Barton Group" >Barton Group</a></div>\r
45 \r
46 <!-- panel end-->\r
47 <div id="content">\r
48 <h2 id="headtitle">JABAWS MANUAL</h2>\r
49 \r
50 <h2>JABAWS Server Web Application aRchive (WAR) </h2>\r
51 <ul>\r
52   <li><a href="#sysreq">System Requirements</a></li>\r
53   <li><a href="#instwar">Installing the JABAWS WAR file</a></li>\r
54   <li><a href="#prepexec">Preparing executables for use with JABAWS</a></li>\r
55   <li><a href="#useprebin">Using the pre-compiled i386 binaries on Linux</a></li>\r
56   <li><a href="#recompbinaries">Recompiling the bundled\r
57     programs for your system</a></li>\r
58   <li><a href="#haveexec">Reuse the binaries that are\r
59     already in your system</a></li>\r
60   <li><a href="#obtainexec">Obtaining command line binaries </a><a href="#obtainexec">for your operating system</a></li>\r
61   <li><a href="#usingWsTester">Testing JABAWS Server</a></li>\r
62   <li><a href="#diffcontexts">Running many JABAWS instances on the same server</a> </li>\r
63   <li><a href="#nocluster">JABAWS on a single server</a></li>\r
64   <li><a href="#clustsubsys">JABAWS supported cluster batch management systems </a></li>\r
65   <li><a href="#tomstopundeploy">Manually deploying JABAWS application on Apache-Tomcat </a></li>\r
66 </ul>\r
67 <p><strong>Troubleshooting</strong></p>\r
68 <ul>\r
69   <li><a href="#tomdeploy">Apache-Tomcat fails to deploy the jabaws.war file</a></li>\r
70   </ul>\r
71 <h3><a name="sysreq" id="sysreq"></a>System Requirements</h3>\r
72 <p>JABAWS requires a Java web application server compliant with\r
73 version 2.4 of the Java Servlet specification, and a Java 6 runtime\r
74 environment. We recommend using an official Oracle Java 6 runtime\r
75 environment, and <a\r
76 href="http://tomcat.apache.org/download-60.cgi">Apache-Tomcat</a> web application server version 6, but other versions may work as well.<br/><span class="attention">Please Note:</span> The JABAWS WAR is not generally compatible with older Mac systems based on the PowerPC architecture, since Java 1.6 is not available to run JABAWS.</p>\r
77 \r
78 <p>JABAWS Web Application aRchive can run on any host operating system that supports Java 1.6. However JABAWS depends on a number of 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
79   <!-- todo: link to help about obtaining and installing tomcat -->\r
80 </p>\r
81 <p>JABAWS comes with pre-compiled MS Windows and Linux IA32 binaries, as well as the source code and build scripts necessary to recompile them.</p>\r
82 <p>To run JABAWS on the cluster you must have shared disk space accessible from all cluster nodes. </p>\r
83 <h3><a name="instwar" id="instwar"></a>Installing the JABAWS WAR file</h3>\r
84 <p>JABAWS is distributed as a web application archive (WAR). To\r
85 deploy JABAWS in Apache-Tomcat - simply drop the war file into the\r
86 <span class="highlight">webapps</span> directory of a running\r
87 Tomcat, and it will do the rest. If you used this deployment procedure, <span class="attention">do not remove</span> the jabaws WAR file, otherwise Tomcat will undeploy your application! The context path for your deployed application will be the same as the name of the war file. For example, assuming the Tomcat server is running on the <span class="hightlight">localhost:8080</span> and <strong>jaba.war</strong> file is put into the <span class="hightlight">&lt;tomcat server root&gt;/webapps</span> directory, the deployed application from the jaba.war file then can be accessed by this URL http://localhost:8080/<strong>jaba</strong>. </p>\r
88 <p>For any other web application\r
89   server, please follow your server's specific deployment procedure\r
90   for 'WAR' files. If you install JABAWS on a MS Windows machine, then\r
91   at this point your JABAWS installation will already be up and\r
92   running, and you can try its services out <a href=\r
93 "#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
94 <h3><a name="prepexec" id="prepexec"></a>Preparing executables for use with JABAWS</h3>\r
95 \r
96 <p>JABAWS's web services use command line programs to do\r
97 the actual analysis, so it must have access to programs\r
98 which can be executed on your platform. The native executables\r
99 bundled with JABAWS for Windows (32-bit) and Linux (i386, 32-bit) should be\r
100 OK for those systems. The source code for these \r
101 programs is also provided so you can <a href="#recompbinaries">recompile for your own\r
102 architecture</a> and exploit any optimizations that your system can\r
103 provide. Alternately, if you have already got binaries on your\r
104 system, then you can simply <a href="#haveexec">change the paths in JABAWS's\r
105 configuration files</a> so these are used instead.</p>\r
106 \r
107 <h3><a name="useprebin" id="useprebin"></a>Using the pre-compiled i386 binaries on Linux</h3>\r
108 \r
109 <p>Before the binaries that are bundled with JABAWS can be used,\r
110 they must first be made executable using the provided <a name=\r
111 "setexecflag" id="setexecflag">'setexecflag.sh'</a> script:</p>\r
112 \r
113 <ol>\r
114 <li>cd to <span class=\r
115 "hightlight">&lt;webapplicationpath&gt;/binaries/src</span></li>\r
116 \r
117 <li>run <span class="hightlight">sh setexecflag.sh</span></li>\r
118 \r
119 <li>Make sure binaries supplied work under your OS.<br />\r
120  For this run each binary, without any command line options or\r
121 input files. If you see an error message complaining about missing\r
122 libraries or other problems, then you probably need to <a href=\r
123 "#recompbinaries">recompile the binaries</a>.</li>\r
124 \r
125 <li>Restart the Tomcat.</li>\r
126 </ol>\r
127 \r
128 That's it! JABAWS should work at this point. Try it out using the JABAWS<a\r
129 href="#usingWsTester"> test client</a>. If not,\r
130 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
131  <em>Note: You may want to enable logging, <a href="man_configuration.html#logfiles"> as described here</a></em>.<br />\r
132  \r
133 \r
134 <h3><a name="recompbinaries">Recompiling the bundled\r
135 programs for your system</a></h3>\r
136 \r
137 <p>If you have a fully equipped build environment on your\r
138 (POSIX-like) system, then you should be able to recompile the\r
139 programs from the source distributions which are included\r
140 in the JABAWS war file. A script called 'compilebin.sh' is provided\r
141 to automate this task.</p>\r
142 \r
143 <ol>\r
144 <li>In a terminal window, change the working directory to <span\r
145 class="hightlight">binaries/src</span></li>\r
146 \r
147 <li>execute the <span class="highlight">compilebin.sh</span>\r
148 script,<br />\r
149  either use: <span class="hightlight">chmod +x compilebin.sh;\r
150 compilebin.sh &gt; compilebin.out;</span><br />\r
151  or: <span class="hightlight">sh compilebin.sh &gt;\r
152 compilebin.out</span></li>\r
153 \r
154 <li>Now run <span class="hightlight">sh setexecflag.sh</span><br />\r
155  If any of the binaries was not recompiled, then a 'file not found'\r
156 error will be raised.</li>\r
157 \r
158 <li>Finally, restart your Tomcat server (or JABAWS application only), and <a href="#usingWsTester">test JABAWS</a> to\r
159 check that it can use the new binaries.</li>\r
160 </ol>\r
161 \r
162 <p>If you couldn't compile everything, then it may be that your system does\r
163 not have all the tools required for compiling the programs. At the very\r
164 least check that you have gcc, g++ and make installed in your\r
165 system. If not install these packages and repeat the compilation\r
166 steps again. You should also review the compilebin.sh output -\r
167 which was redirected to compilebin.out, and any errors output to\r
168 the terminal. Finally, try obtaining the <a href="#obtainexec">pre\r
169 compiled binaries</a> for your OS.</p>\r
170 \r
171 <h3><a name="haveexec" id="haveexec">Reuse the binaries that are\r
172 already in your system</a></h3>\r
173 \r
174 <p>If you would like to use the binaries you already have then you\r
175 just need to let JABAWS know there they are. To do this, edit:\r
176 <span class="code">conf/Executable.properties</span></p>\r
177 <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
178 as<span class=\r
179 "code">local.clustalw.bin=binaries/src/clustalw/src/clustalw2</span>\r
180 Alternatively, instead of changing <span class=\r
181 "hightlight">Executable.properties</span> you could also replace\r
182 the executables bundled with JABAWS with the ones that you have, or make symbolic links to them.\r
183 Then the default configuration will work for you. More information\r
184 about <span class="hightlight">the\r
185 Executable.properties</span> file is given in the <a href="man_configuration.html#exec">JABAWS Configuration chapter.</a></p>\r
186 \r
187 <h3><a name="obtainexec" id="obtainexec">Obtaining command line binaries for your operating system</a></h3>\r
188 \r
189 <p>You could search for pre-packaged compiled executable in your\r
190 system package repository or alternately, download pre-compiled\r
191 binaries from each alignment program's home page. Then, either\r
192 replace the executables supplied with the downloaded ones, or\r
193 modify the paths in <span class=\r
194 "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
195 <ul>\r
196   <li><a href="http://www.clustal.org/omega/#Download">Clustal Omega </a></li>\r
197   <li><a href="ftp://ftp.ebi.ac.uk/pub/software/clustalw2/2.0.12/">ClustalW</a></li>\r
198   <li><a href="http://mafft.cbrc.jp/alignment/software/">Mafft</a></li>\r
199   <li><a href="http://www.drive5.com/muscle/download3.6.html">Muscle</a></li>\r
200   <li><a href="http://www.tcoffee.org/Packages/Binaries/">Tcoffee</a></li>\r
201   <li>Probcons (Linux <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linux_x86/probcons">x86</a> | <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linux_x64/probcons">x64</a> | <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/mac/probcons">Mac</a>)</li>\r
202   <li>IUPred (Linux <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linux_x86/iupred">x86</a> | <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/linux_x64/iupred">x64</a> | <a href="http://www.compbio.dundee.ac.uk/jabaws/archive/binaries/mac/iupred">Mac</a>)</li>\r
203 </ul>\r
204 <h3><a name="usingWsTester" id="usingWsTester"></a>Testing JABAWS Server </h3>\r
205 <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
206 <p>For example to test all JABAWS web services on host myhost.compbio.ac.uk type: </p>\r
207 <p class="code">java -jar jabaws-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws </p>\r
208 <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
209 <p>An example of the report testing tool produces for operating web service looks like this: </p>\r
210 <p><span class="code"> Connecting to service MuscleWS on http://myhost.compbio.ac.uk:8080/jabaws ... OK<br />\r
211   Testing alignment with default parameters:<br />\r
212   Queering job status...OK<br />\r
213   Retrieving results...OK<br />\r
214   Testing alignment with presets:<br />\r
215   Aligning with preset 'Protein alignment(Fastest speed)'... OK<br />\r
216   Aligning with preset 'Nucleotide alignment(Fastest speed)'... OK<br />\r
217   Aligning with preset 'Huge alignments (speed-oriented)'... OK<br />\r
218   Queering presets...OK<br />\r
219   Queering Parameters...OK<br />\r
220   Queering Limits...OK<br />\r
221   Queering Local Engine Limits...OK<br />\r
222   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
223 <p><span class="code">Connecting to service ProbconsWS on http://localhost:8080/ws ... OK<br />\r
224   Testing alignment with default parameters:FAILED<br />\r
225   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
226 <h3><a name="diffcontexts" id="diffcontexts"/></a></a>Running many JABAWS instances on the same server</h3>\r
227 <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
228 <h3><a name="nocluster" id="nocluster"></a>JABAWS on a single server</h3>\r
229 <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
230 <h3><a name="clustsubsys" id="clustsubsys"></a>JABAWS supported cluster batch management systems </h3>\r
231 <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
232 <h3><a name="tomstopundeploy" id="tomstopundeploy"></a>Manually deploying JABAWS application on Apache-Tomcat </h3>\r
233 <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
234 <p class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />\r
235   &lt;Context antiResourceLocking=&quot;false&quot; privileged=&quot;true&quot;  /&gt;</p>\r
236 <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
237 <h3><a name="tomdeploy" id="tomdeploy"></a>Apache-Tomcat fails to deploy jabaws.war file </h3>\r
238 <ul>\r
239   <li>Make sure Tomcat have sufficient access rights to read your war file. </li>\r
240   <li>Restart the Tomcat, sometimes it will not since that the new war file is added without restart</li>\r
241   <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). Restart the Tomcat.</li>\r
242 </ul>\r
243 </div>\r
244 \r
245 <!-- content end-->\r
246 <div id="copyright">Last update: 1 August 2011<br />\r
247  Peter Troshin, Jim Procter and Geoff Barton, The Barton Group, University of\r
248 Dundee, UK</div>\r
249 </div>\r
250 \r
251 <!-- wrapper end-->\r
252 </div>\r
253 <!-- page end-->\r
254 \r
255 <!-- Google analitics -->\r
256 <script type="text/javascript">\r
257 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");\r
258 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));\r
259 </script>\r
260 <script type="text/javascript">\r
261 try{\r
262 var pageTracker = _gat._getTracker("UA-5356328-1");\r
263 pageTracker._trackPageview();\r
264 } catch(err) {}\r
265 </script>\r
266 </body>\r
267 </html>\r
268 \r