Search code examples
apachewebspherevirtualhostibmhttpserver

How to split WebSphere virtual hosts, single webserver for multiple JVMs


How can I configure the virtual hosts to send the right url to the right JVM, when all of the apps use the same context root?

eg:

Info

I have multiple JVMs, and all apps have the same context root:

  • app1 (context root: /myapp) (internal port: 9080)
  • app2 (context root: /myapp) (internal port: 9081)
  • app3 (context root: /myapp) (internal port: 9082)

I have one webserver:

  • webserver1

I have multiple subdomains:

  • app1.mydomain.com
  • app2.mydomain.com
  • app3.mydomain.com

Notes

  • I'm trying to avoid using multiple IP addresses or webservers
  • Running Websphere 9.0.0.6, IBM HTTP Server (Apache), Windows 2016

Solution

  • If you define three virtual hosts in WAS, each with the right non-wildcard host aliases and map each respective application to its virtualhost, the generated plugin-cfg.xml will route the way you want.