If you tried the hosted version of WSO2 Stratos at cloud.wso2.com and wants to get down to install it in your virtualized environment, this will help you to build it from the source code. Before you build WSO2 Stratos you have to build WSO2 Carbon. This guide only assumes that you’ve installed Sun JDK and Apache Maven which is in your PATH.
Building WSO2 Stratos
- Checkout WSO2 Carbon and WSO2 Stratos
$ svn checkout http://svn.wso2.org/repos/wso2/trunk/carbon $ svn checkout http://svn.wso2.org/repos/wso2/trunk/stratos
- In order to build WSO2 Carbon, first need to build two Axis2 plugins. As the Axis2 README points out, this is due to some dependency resolution issues in Maven
- Build Axis2 AAR Maven plugin
$ cd carbon/dependencies/axis2/modules/tool/axis2-aar-maven-plugin/ $ mvn clean install
- Bulid Axis2 MAR Maven plugin
$ cd carbon/dependencies/axis2/modules/tool/axis2-mar-maven-plugin/ $ mvn clean install
- Build Axis2 AAR Maven plugin
- Build Carbon dependencies
$ cd carbon/dependencies $ mvn clean install
- Build Carbon Orbit
$ cd carbon/orbit $ mvn clean install
- Bulid Carbon core
$ cd carbon/core $ mvn clean install
- Bulid Carbon components
$ cd carbon/components $ mvn clean install
- Build Carbon features
$ cd carbon/features $ mvn clean install
- Build WSO2 Stratos
- Bulid WSO2 Stratos components
$ cd stratos/components $ mvn clean install
- Build WSO2 Stratos features
$ cd stratos/components $ mvn clean install
- Build WSO2 Stratos services
$ cd stratos/services $ mvn clean install
This will create binary distributions for each service in,
stratos/services//target/modules/distribution
- Bulid WSO2 Stratos components
Configuring WSO2 Stratos
Cloud manager is a special program designed to manage all other services. Therefore some configuration parameters differ from other services. There are some configuration parameters which are common across all the services.
Once you build WSO2 Stratos, unzip binary packages to a folder. <statos dir> in the following configurations refer to the folder you get when you unzip a binary distribution.
Common configurations
These are common to cloud manager as well as other services. Configuration files are located at <stratos dir>/repository/conf
carbon.xmlYou should change ServerURL, HostName, and Name parameter. E.g.,
<ServerURL>https://example.com${carbon.context}/services/</ServerURL> <HostName>example.com</HostName> <Name>WSO2 Stratos Cloud Application Server</Name> (this name should be same as the name given in cloud-services-desc.xml cloud manager)axis2.xmlConfigure mail transport. E.g.,
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender"> <parameter name="mail.smtp.host">smtp.example.org</parameter> <parameter name="mail.smtp.port">25</parameter> <parameter name="mail.smtp.starttls.enable">false</parameter> <parameter name="mail.smtp.auth">true</parameter> <parameter name="mail.smtp.user">user</parameter> <parameter name="mail.smtp.password">password</parameter> <parameter name="mail.smtp.from">noreply@example.com</parameter> </transportSender>mgt-transport.xmlConfigure proxy ports. E.g.,
<transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport"> <parameter name="port">9763</parameter>1 <parameter name="proxyPort">80</parameter> ... <transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport"> <parameter name="port">9443</parameter> <parameter name="proxyPort">443</parameter>registry.xmlDatabase configuration. E.g.,
</dbConfig> <dbConfig name="WSO2Registry"> <url>jdbc:mysql://db.example.com:3306/registry_db?autoReconnect=true</url> <userName>user</userName> <password>password</password> <driverName>com.mysql.jdbc.Driver</driverName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <minIdle>5</minIdle> <validationQuery>SELECT 1</validationQuery> </dbConfig>user-mgt.xmlConfigure user store. E.g.,
<Property name="url">jdbc:mysql://db.example.com:3306/userstore_db?autoReconnect=true</Property> <Property name="userName">user</Property> <Property name="password">password</Property> <Property name="driverName">com.mysql.jdbc.Driver</Property> <Property name="maxActive">50</Property> <Property name="maxWait">60000</Property> <Property name="minIdle">5</Property> <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder</Property> <Property name="validationQuery">SELECT 1</Property>
- Copy MySQL JDBC driver to
<stratos dir>/repository/components/lib. MySQL JDBC driver can be downloaded from http://dev.mysql.com/downloads/connector/j/ wrapper.confwrapper.java.additional.11=-Dcarbon.https.port=443 wrapper.java.additional.12=-Dcarbon.http.port=80
axis2_client.xmlIncrease SO_TIMEOUT of http and https about 60 seconds
<parameter name="SO_TIMEOUT">60000</parameter>
Cloud Manager Configuration
billing-config.xmlDatabase configuration. E.g.,
<dbConfig> <url>jdbc:mysql://db.example.com:3306/billing_db?autoReconnect=true</url> <userName>user</userName> <password>password</password> <driverName>com.mysql.jdbc.Driver</driverName> <maxActive>80</maxActive> <maxWait>60000</maxWait> <minIdle>5</minIdle> <validationQuery>SELECT 1</validationQuery> </dbConfig>tenant-reg-agent.xml<tenantRegListenerServers> <server> <!-- governance --> <serverUrl>https://governance.example.com/services/</serverUrl> <userName>admin</userName> <password>password</password> </server> <server> <!-- identity --> <serverUrl>https://identity.example.com/services/</serverUrl> <userName>admin</userName> <password>password</password> </server> <server> <!-- gadget --> <serverUrl>https://gadget.example.com/services/</serverUrl> <userName>admin</userName> <password>password</password> </server> ... </tenantRegListenerServers>cloud-services-desc.xml<cloudService name="WSO2 Stratos Cloud Governance"> <label>Cloud Governance</label> <link>https://governance.example.com</link> <description>Governance in the cloud.</description> <icon> https://example.com/cloud-services-icons/governance.gif </icon> </cloudService>- All the configurations starting with email_ should be modified with correct
cloud manager URL
Other services
Other services means all the services except could manager.
metering-config.xmlMetering configuration have to be changed to include cloud admin username, password (in post handler and pre handler)
<handler service="org.wso2.stratos.metering.agent.handlers.RemoteTaskInvoker" async="true" frequency="1"> <parameter name="taskServiceUrl">https://cloud.wso2.com/services/</parameter> <parameter name="userName">user</parameter> <parameter name="password">password</parameter> <parameter name="taskName">org.wso2.stratos.metering.manager.task.PerRegistryRequestRemoteTask</parameter> </handler>- In Appserver
carbon.xml, you can specify the URL for BAM so that you can monitor appserver.<BamServerURL>https://bam.example.com/services/BAMServiceStatisticsSubscriberService</BamServerURL>
That’s it!