Wednesday, October 14, 2009

How to deploy WSO2 Mashup on Apache Tomcat

The WSO2 Mashup Server provides a platform for rapidly deploying Web service Mashups. Combining simple yet rich mashups with reusability, security, reliability and governance, the WOS2 Mashup Server offers enterprise-class service composition.

WSO2 Mashup can be deployed on most of the application servers.
I will be describing how one can easily deploy WSO2 Mashup on Apache Tomcat.

Step1
Download wso2mashup-2.0.0.zip and unzip the package.Copy conf, database, repository and resources directories in to a new folder. (i.e:- /home/sarasi/mashup/mahupRepo).

Step2
Download Apache Tomcat (apache-tomcat-6.0.14.zip) and unzip the packege.

Step3
Set the environment variable named “CARBON_HOME” to point to the folder named “mashupRepo”.
Ex:
your mashupRepo folder in “/home/sarasi/mashup/mahupRepo
If you are using Linux,

export CARBON_HOME =
/home/sarasi/mashup/mahupRepo
If you are using Windows,

set CARBON_HOME = D:\
mashup\mahupRepo

Step4
Now, Mashup needs to be deployed in Apache Tomcat. To do so, follow the instructions below:
  • Copy “WEB-INF” in unzipped Mashup package/webapps/ROOT.
  • Create a folder in Tomcat “webapps” folder and paste the WEB-INF folder there.(Ex:/home/sarasi/apache-tomcat-6.0.14/webapps/ms/WEB-INF)
Step5
Now, you need to enable https in your Tomcat installation.(By default HTTPS protocol is disable in Apache Tomcat.)
  • Open server.xml in Apache Tomcat conf folder. Add the following script tag need to Apache Tomcat's server.xml file.

port="8443" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="CARBON_HOME/resources/security/wso2carbon.jks" keystorePass="wso2carbon"
clientAuth="false" sslProtocol="TLS"/>


  • HTTPS 8443 port is now open for Apache Tomcat.
Step6
Next, you should change Mashup “Server URL” in the carbon.xml file. You need to add the name of the folder you created in the Tomcat web apps folder as the server url. Following are the steps to change carbon.xml:
  • Open carbon.xml file in your CARBON_HOME/conf folder.
  • Change the HTTPS port number from 9443 to 8443. (Tomcat HTTPS enables in port 8443)
  • If the name of the folder in WSAS webapps is “ms”,Your Final server url should be:
    https://localhost:8443/ms/services/
Step7
You need to now do a small modification in Axis2.xml as well. In Tomcat, HTTP transport is enabled in port 8080, but for Mashup HTTP it is enabled in port 9763. Because of this you have to re-map the HTTP and HTTPS port umbers in Mashup Axis2.xml. Change the HTTP port number from 9763 to 8080 and HTTPS from 9443 to 8443. This should be as follows:

class="org.wso2.carbon.core.transports.http.HttpTransportListener"> 8080 class="org.wso2.carbon.core.transports.http.HttpsTransportListener"> 8443

Step8

Open registry.xml and user-mgt.xml.Update DB URL as follows.

jdbc:derby:/home/sarasi/mashup/mahupRepo/database/WSO2CARBON_DB

Step9
Apache Tomcat configurations are all completed now. Start the Tomcat server. Here are the steps:
  • Go to Tomcat's bin folder on command prompt.Start tomcat as,(Windows = apache-tomcat-6.0.14\bin>catalina.bat run , Linux = apache-tomcat-6.0.14\bin>catalina.sh run)
Step10
Upon starting up Apache Tomcat, use the following URL to access Mashup:
https://localhost:8443/ms/carbon

2 comments: