Setting the default host name of a Liberty server

You can add the defaultHostName variable to the server.xml file to set the default host name by which a Liberty server is identified.

About this task

This variable is available for use by service configurations. Setting this value is particularly important for multihomed systems (with multiple NICs and multiple mapped host names for example).

Notes:
  • This variable is currently used by the <httpEndpoint> host attribute and the <hostAuthInfo> rpcHost attribute
  • The default host name must be the fully qualified host name of the system.
  • The value must not contain any wildcards (* for example).
  • The variable default is localhost.

Procedure

To set the default host name by which a Liberty server is identified, add the defaultHostName variable to the server.xml file.
For example:
<variable name="defaultHostName" value="localhost" />