This documentation is for WSO2 API Manager 2.6.0. View documentation for the latest release.

All docs This doc
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

By default, WSO2 products identify the hostname of the current machine through the Java API. However, this value sometimes yields erroneous results on some environments. Therefore, users are recommended to configure the hostname. The following procedure explains how to change the hostname and management hostname of WSO2 API Manager (WSO2 API-M) as required for your production environment. 

  1. Open the <API-M_HOME>/repository/conf/carbon.xml file and set the HostName and MgtHostName property as shown below.

    <HostName>{hostname}</HostName>
    <MgtHostName>{management-hostname}</MgtHostName>

    {hostname} - Hostname or IP address of the machine hosting this server. This is will become part of the End Point Reference of the services deployed on this server instance.

    {management-hostname} - Hostname to be used for the WSO2 API-M Management console.

    <HostName>am.dev.wso2.com</HostName>
    <MgtHostName>am.dev.wso2.com</MgtHostName>
  2. Open the <API-M_HOME>/repository/conf/api-manager.xml file and set the HostName and MgtHostName property as shown below. 

    1. Configure the Store URL, which is used to access the Store web app from the Publisher application. 

      <APIStore>
              <!--GroupingExtractor>org.wso2.carbon.apimgt.impl.DefaultGroupIDExtractorImpl</GroupingExtractor-->
              ...
              <URL>[mgt-transport-https-hostname]:[mgt-transport-https-port]/store</URL>
      		...
      </APIStore>

      [mgt-transport-https-port] - This port is optional, because if you are fronting the Store nodes with a load balancer, you need to enter the load balancer URL as the Store URL as opposed to entering the hostname and port separately.

      <APIStore>
              <!--GroupingExtractor>org.wso2.carbon.apimgt.impl.DefaultGroupIDExtractorImpl</GroupingExtractor-->
              ...
              <URL>https://store.wso2.com</URL>
      		...
      </APIStore>
    2. Configure the Publisher URL, which is the URL that is used to access the tenant Store and public Store.

          <APIPublisher>
              ...
              <URL>[mgt-transport-https-hostname]:[mgt-transport-https-port]/publisher</URL>
      		...
          </APIPublisher>
          <APIPublisher>
              ...
              <URL>https://publisher.wso2.com</URL>
      		...
          </APIPublisher>
    3. Configure the environment configurations by defining the endpoint URL for both the REST APIs and Web Socket (WS) APIs that are hosted in the API Gateway.

          <APIGateway>
              <Environments>
                  <Environment type="[environment-type]" api-console="true">   
      				<!-- Endpoint URLs for the APIs hosted in this API gateway.-->
                      <GatewayEndpoint>[http-gateway-hostname]:[http-gateway-nio-port],https://[https-gateway-hostname]:[https-gateway-nio-port]</GatewayEndpoint>
                      <!-- Endpoint of the Websocket APIs hosted in this API Gateway -->
                      <GatewayWSEndpoint>ws://[gateway-hostname]:[gateway-ws-port]</GatewayWSEndpoint>
                  </Environment>
              </Environments>
          </APIGateway>
          <APIGateway>
              <Environments>
                  <Environment type="[environment-type]" api-console="true">   
      				<!-- Endpoint URLs for the APIs hosted in this API gateway.-->          
                      <GatewayEndpoint>http://gateway.wso2.com,https://gateway.wso2.com</GatewayEndpoint>
                      <!-- Endpoint of the Websocket APIs hosted in this API Gateway -->
                      <GatewayWSEndpoint>ws://gateway.wso2.com</GatewayWSEndpoint>
                  </Environment>
              </Environments>
          </APIGateway>
  3. Generate a key store, export the public certificate from the keystore, and import that certificate to the  client­-truststore.jks  file.
    For more information, see Creating New Keystores in the WSO2 Administration guide.

What's Next?


After changing your hostname and management hostname, make sure to whitelist your hostname for the API Store.

  • No labels