Bootstrap FreeKB - IBM WebSphere - Change application server port
IBM WebSphere - Change application server port

Updated:   |  IBM WebSphere articles

This assumes that you have already created a WebSphere application server. Let's say you want to update the application server to use port 12345 for HTTP requests.

  1. In the WebSphere admin console, select Servers Server Types WebSphere application servers.
  2. Select an application server.
  3. Select Ports.
  4. Select the port you want to change.
  5. Enter the new port value (12345 in this example).
  6. Select OK.
  7. Select Save.

Or, this could be done via the following wsadmin commands. In this example, the WC_defaulthost port in the application server named "server1" is updated to 12345. This example uses the Jython scripting language.

AdminTask.modifyServerPort('server1', '[-nodeName AppSrv01Node01 -endPointName WC_defaulthost -host * -port 12345 -modifyShared true]')

 

The serverindex.xml file will be updated to contain the new port value.

${WAS_INSTALL_ROOT}/profiles/your_profile/config/cell/your_cell/nodes/your_node/serverindex.xml

 

Like this.

<endPoint xmi:id="EndPoint_157063038771" host="*" port="12345"/>

 

In this example, since the HTTP port was updated, the web container transport chain will have also been updated to the new port.

  1. Select Servers Server Types WebSphere application servers.
  2. Select the application server.
  3. Select Web Container Settings > Web container transport chains.

Notice HttpQueueInboundDefault and WCInboundDefault have the new port value, 12345.

 

You will also need to update the Virtual Host to the new port value.

  1. Select Environment > Virtual Hosts.
  2. Select the virtual host that contains the port (usually default_host).
  3. Select Host Aliases.
  4. Select the prior port value.
  5. Enter the new port value (12345 in this example).
  6. Select OK.
  7. Select Save.

Or, this could be done via the following wsadmin commands. First, the list of host aliases is returned. Then, the appropriate host alias is updated to port 12345. This example uses the Jython scripting language.

AdminConfig.list('HostAlias', AdminConfig.getid( '/Cell:DmgrCell01/VirtualHost:default_host/'))

AdminConfig.modify('(cells/DmgrCell01|virtualhosts.xml#HostAlias_1576070497346)', '[[hostname "*"] [port "12345"]]')

 

The virtualhosts.xml file will be updated to contain the new port value.

${WAS_INSTALL_ROOT}/profiles/your_profile/config/cell/your_cell/virtualhosts.xml

 

Like this.

<aliases xmi:id="HostAlias_39484040881332" hostname="*" port="12345"/>

 

Restart the application server to put this change into effect. The application server should now be configured to use the new port. In this example, applications deployed to the application server can now be accessed on the new port 12345.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 23db80 in the box below so that we can be sure you are a human.