Thursday, October 15, 2009

How to Setup WSO2 Mashup on JBoss

The WSO2 Mashup Server is a powerful yet simple and quick way to tailor Web-based information to the personal needs of individuals and organizations.
WSO2 Mashup can be deployed on most of the application servers.This post describes the steps to deploy WSO2 Mashup on JBOSS.



Step1
Download WSO2 Mashup Server here and unzip the package.

Step2

Download jboss-5.0.0.GA.zip and unzip the package.

Step3
Copy conf, database, repository and resources directories in to a new folder.

Ex:/home/sarasi/ms/msRepo

Step4

  • I refer to my jboss installation directory as JBOSS_HOME.
  • Go to JBOSS_HOME/server/default/deploy directory.
  • And create a new folder,ms.war inside that directory.
  • copy wso2mashup-2.0.0/webapps/ROOT/WEB-INF to JBOSS_HOME/server/default/deploy/ms.war.
Steps5
  • Now, you need to enable https in JBoss.
  • Open server.xml in JBOSS_HOME/server/default/deploy/jbossweb.sar directory.
  • Edit it by adding the following entry.


port="8443" address="${jboss.bind.address}"
scheme="https" secure="true" clientAuth="false"
keystoreFile="/home/sarasi/ms/msRepo/resources/security/wso2carbon.jks"
keystorePass="wso2carbon" sslProtocol = "TLS" />


  • give the exact location of wso2carbon.jks
Step6
You will update carbon.xml, axis2.xml, registry.xml and user-mgt.xml which can be found at msRepo/conf directory.
  • open carbon.xml and update the ServerURL element as follows.
https://localhost:8443/ms/services/
  • Open registry.xml and user-mgt.xml and update DB URL as follows.
jdbc:derby:/home/sarasi/ms/msRepo/database/WSO2CARBON_DB;create=true
  • We must change the http and https ports in In Transports section of axis2.xml as follows.

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

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


Step7
  • open a new command window/shell and change the directory to JBOSS_HOME/bin.
  • Set the environment variable named “CARBON_HOME” to point to the folder named “msRepo”.
In windows; set CARBON_HOME=C:\ms\msRepo

In linux; export CARBON_HOME=/home/sarasi/ms/msRepo
  • Start JBoss from the same command window/shell.
  • Now, You can access the management console using https://localhost:8443/ms/carbon.

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