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.
Open the
<API-M_HOME>/repository/conf/carbon.xml
file and set theHostName
andMgtHostName
property as shown below.- Generate a key store by following the sub steps given below.
Open a terminal and issue the following command to generate a key store.
- Specify a preferred KeyStore password once prompted.
- Specify a preferred Key password once prompted.
Enter the first name and last name as follows once prompted.
*.am.dev.wso2.com
- Enter values for the other parameters as required.
am.dev.wso2.com
as the CN. - Copy the generated self-signed key store (i.e.,
apimkey.jks
) to the<API-M_HOME>/repository/resources/security
directory. - Export the public certificate from the keystore and import that certificate to the
client-truststore.jks
file following the steps given below. - Navigate to the
<API-M_HOME>/repository/resources/security
directory. Issue the following command to export the public certificate from the primary key store
keytool -export -alias am.dev.wso2.com -file am.dev.wso2.com -keystore apimkey.jks -storepass <keystore_password_given_above>
Issue the following command to import the certificate to the
client-truststore.jks
file.keytool -import -alias am.dev.wso2.com -file am.dev.wso2.com -keystore client-truststore.jks -storepass wso2carbon