Installing and Running Doradus : Running Doradus using Tomcat

Running Doradus using Tomcat
Instead of using the embedded Jetty server to serve its REST API, you can host Doradus in the Apache Tomcat server. The folder doradus-tomcat contains interface source files, a web.xml file, and a pom.xml build file. (Currently, this project only supports Maven builds.) To use the Tomcat interface, use the following steps:
1)
2)
Copy the latest doradus.yaml file from ./doradus-server/src/main/resources to ./doradus-tomcat/src/main/resources.
3)
Modify the doradus.yaml and comment-out the webserver_class parameter. Example:
#webserver_class: com.dell.doradus.server.JettyWebServer
Commenting-out this line prevents Doradus from trying to initialize an embedded web server. Make any additional changes you need to this file at the same time.
4)
The provided web.xml file allows Doradus REST commands to respond to ROOT URIs (no prefix) or the special prefix _api. For example, if Doradus runs as ROOT, the “list applications” command will be:
GET /_applications
If Doradus is assigned the URI prefix _api, the “list applications” command will be:
GET /_api/_applications
If you’d like to use a different API prefix, modify web.xml and add a section such as the following:
<!--Doradus running with URI prefix "Fuzzy" -->
<servlet-mapping>
<servlet-name>DoradusRestServlet</servlet-name>
<url-pattern>/Fuzzy/*</url-pattern>
</servlet-mapping>
5)
Generate the war file by compiling doradus-tomcat using pom.xml in the root folder. If Doradus will use no URI prefix, use the following command:
$ mvn compile war:war -Dwar.warName=ROOT
If Doradus will use a URI prefix, change ROOT to the appropriate prefix name.
6)
Copy the war file (e.g., ROOT.war or _api.war) from the target folder to <TOMCAT_HOME>/webapps.
7)
8)
Start Tomcat from the <TOMCAT_HOME>/bin folder, e.g., with ./catalina.sh run on Mac or Linux or just catalina for Windows. The doradus-tomcat war file will be expanded automatically when Tomcat starts.
Note that the doradus.log file should appear in the <TOMCAT_HOME>/bin folder.