How to change the hostname and context path of web-UI-app URL in WSO2 SP-based Analytics

Umesha Guruge
2 min readMay 11, 2020

--

WSO2 SP-based-Analytics-products have different web-UI-apps to display different kinds of statistics depending on the product (APIM, IS, or EI). Apps such as portal, policies, monitoring, and business-rules. If you are familiar with WSO2 Analytics products, you know that when the Analytics dashboard server is started we are given URLs to access the respective web-UI-apps. These URLs are shown in the carbon log.

For example, if we start an EI-Analytics dashboard server the following loglines will appear in the carbon log.

INFO {org.wso2.carbon.uiserver.internal.deployment.listener.AppTransportBinder} — Web app ‘portal’ is available at ‘https://x.x.x.x:9643/portal'.

As you can see the URL is given in the format ‘ IP-address: port/web-UI-app’ (x.x.x.x:9643/portal).

Suppose we want to change the IP address into a hostname. And, for the demonstration, we will say the hostname we need to add is ‘dashboard-server’.

To proceed with that, we have to navigate to the configuration file of the dashboard in the below path:

<EI-HOME>/wso2/analytics/conf/dashboard/deployment.yaml.

Open the .yaml file and add the required hostname under the section “wso2.transport.http: listenerConfigurations” as shown below.

wso2.transport.http:
listenerConfigurations:
- id: "default-https"
host: "dashboard-server"
port: 9643
scheme: https
keyStoreFile: "${carbon.home}/resources/security/wso2carbon.jks"
keyStorePassword: wso2carbon
certPass: wso2carbon

(Please note that this hostname should be mapped in the /etc/hosts file with the IP-address.)

After the modification, if we restart the server, the URL will be given like this in the carbon log.

INFO {org.wso2.carbon.uiserver.internal.deployment.listener.AppTransportBinder} — Web app ‘portal’ is available at ‘https://dashboard-server:9643/portal’.

So our URL looks like this → ‘https://dashboard-server:9643/portal

Now let’s see how we can change the name of the web-UI-app. Here our app is the portal. So to change ‘/portal’ part to another name, let’s say ‘ei-dashboard’, we have to edit the same deployment.yaml file of the dashboard.

Open it and add the following configuration block to the file (This doesn't come in the default config file).

wso2.carbon-ui-server:
apps:
# configurations for the Portal app
"portal":
contextPath: "/ei-dashboard"

After this modification, if we restart the server, the URL will be given like this in the carbon log.

INFO {org.wso2.carbon.uiserver.internal.deployment.listener.AppTransportBinder} — Web app ‘portal’ is available at ‘https://dashboard-server:9643/ei-dashboard’.

So to summarize in one sentence, we changed the URL from https://x.x.x.x:9643/portal to https://dashboard-server:9643/ei-dashboard

Hope this will be useful to you! Cheers!

--

--