Changing the Hostname¶
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.
-
Update the
deployment.toml
file.-
Open the
<API-M_HOME>/repository/conf/deployment.toml
file -
Define the
hostname
attribute under server configurations as shown below.[server] hostname = "{hostname}"
[server] hostname = "am.dev.wso2.com"
{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. -
Configure the Developer Portal URL, which is used to access the Developer Portal via the Publisher.
Uncomment the following configuration and define the
hostname
.[apim.devportal] url = "https://<hostname>:${mgt.transport.https.port}/devportal"
-
-
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.
-
Restart the server.
Warning
After you change the hostname, if you encounter login failures when trying to access the API Publisher and API Developer Portal, with the error
Registered callback does not match with the provided url
, see 'Registered callback does not match with the provided url' error in the Troubleshooting guide.