Thursday, June 6, 2013

How to set port offset of WSO2 API Manager 1.4.0

WSO2 API Manager is a complete solution for managing API through its lifecycle, powered by WSO2 Enterprise Service Bus, WSO2 Identity Server, WSO2 Governance Registry and WSO2 Business Activity Monitor.
Today I am going to talk about changing the port offset of WSO2 API Manager. Basically my requirement here is to start two servers in the same server without clashing each other but everybody who need to have a port offset in WSO2 API Manager should follow this.


WSO2 API Manager is bit different than the other WSO2 servers from setting the offset since we it has little more work than other servers where in other WSO2 servers we only have to set the offset value in the carbon.xml. Following steps shows you how to set port offset in WSO2 API Manager.
  • Set offset in the $CARBON_HOME/repository/conf/carbon.xml to any value you want.
 
         
         2
  • Set the Thrift client and server ports in $CARBON_HOME/repository/conf/api-manager.xml to (10397 + portOffSet) as shown in below.
        

        ThriftClient
        10399
        10000
        10399
        
        true
  • This is the most valuable configurations where without this configuration API Store will never work with port offset. Now change the endpoint configuration in the following files to suit your port offset

    1. $CARBON_HOME/repository/deployment/server/synapse-configs/default/api/_LoginAPI_.xml - This configuration involves with user login to the API Store.
    2. $CARBON_HOME/repository/deployment/server/synapse-configs/default/api/_TokenAPI_.xml - This configuration involves with generating OAuth token.
    3. $CARBON_HOME/repository/deployment/server/synapse-configs/default/api/_AuthorizeAPI_.xml - This configuration involves with authorize a OAuth token.
         Here is a sample configuration for _AuthorizeAPI_.xml where my offset is 2.
<endpoint>
    <address uri="https://localhost:9445/oauth2/authorize"/>
</endpoint>
    Now you are done and your WSO2 API Manager is ready to start with the port offset.

2 comments:

  1. It helped me a lot I was struggling with working on ESB and API manager on same machine...

    ReplyDelete