How to Setup WSO2 WSAS 2.0 on Apache Tomcat
- By Chamara Silva
- 17 Dec, 2008
- Reads: 12078
WSO2 Web Services Application Server is an open source service-based application server fully built on Apache Axis2 framework. It supports various Web services standards and protocols.
WSO2 Web Services Application Server is capable of being deployed on most common application servers. These include application servers such as Apache Tomcat , IBM WebSphere , BEA WebLogic Server and JBoss. In this tutorial, I explain, how WSAS can be deployed on the Apache Tomcat application server. Following are the steps that need to be followed:
Download the Web Services Application Server and unzip the package.
Download Apache Tomcat and unzip the package
Tomcat needs WSAS resource files running on it, in addition to the WSAS deployment package during run time. So you should assign the entire resource file in one environment variable. To do so,
A. Copy “resources”, ”conf”,"database" and “repository” folders from WSAS unzipped package
B. Create a new folder and name it as a “CarbonRepo”
C. Paste the copied folder on to “CarbonRepo”
D. Set the environment variable named “CARBON_HOME” to point to the folder named “CarbonRepo”
Ex: your CarbonRepo folder in “D:\Projects\Carbon\WSAS\ CarbonRepo”
If you are using Linux,
export CARBON_HOME =/Projects/Carbon/WSAS/ CarbonRepo
If you are using Windows,
set CARBON_HOME = D:\Projects\Carbon\WSAS\ CarbonRepo
Now, WSAS needs to be deployed in Apache Tomcat. To do so, follow the instructions below:
A. Copy “WEB-INF” in unzipped WSAS package/ webapps/ROOT
B. Create a folder in Tomcat “webapps” folder and paste the WEB-INF folder there
Now, you need to enable https in your Tomcat installation.(By default HTTPS protocol is disable in Apache Tomcat.)
A. Open server.xml in Apache Tomcat conf folder. Add the following script tag need to Apache Tomcat's server.xml file.
<Connectorport="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"/><!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
B. You need to locate wso2carbon.jks keystore file in keystoreFile parameter, inside the Connector tag.
If your CARBON_HOME is in “D:\Projects\Carbon\WSAS\ CarbonRepo”, here is the complete path that needs to be added in the kerstoreFile parameter.
“D:/Projects/Carbon/WSAS/ CarbonRepo /resources/security/wso2carbon.jks”
Next, you should change WSAS “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 WSAS carbon.xml:
A. Open carbon.xml file in your CARBON_HOME/conf folder.
B. Change the HTTPS port number from 9443 to 8443. (Tomcat HTTPS enables in port 8443)
C. If the name of the folder in WSAS webapps is “WSAS”,
D. Your Final server url should be:
You need to now do a small modification in Axis2.xml as well. In Tomcat, HTTP transport is enabled in port 8080, but for WSAS HTTP it is enabled in port 9763. Because of this you have to re-map the HTTP and HTTPS port umbers in WSAS Axis2.xml. Change the HTTP port number from 9763 to 8080 and HTTPS from 9443 to 8443. This should be as follows:
Ex: - <parameter name="contextRoot">/carbon</parameter>
Apache Tomcat configurations are all completed now. Start the Tomcat server. Here are the steps:
A. Go to Tomcat's bin folder on command prompt.
B. Start tomcat as,
Windows = apache-tomcat-6.0.14\bin>catalina.bat run
Linux = apache-tomcat-6.0.14\bin>catalina.sh run
Upon starting up Apache Tomcat, use the following URL to access WSAS:
Author: Chamara Silva is a Senior Software Engineer at WSO2. chamara at wso2 dot com