0

Possible Duplicate:
How to run different apps on single Tomcat instance behind different ports?

Is there a way to configure Tomcat 7 to host specific web application on alternative port?

I am aware that I can change port for connector in conf/sever.xml, but this changes listening port globally, for all webapps deployed in tomcat instance.

I cannot use transparent proxy or any other intermediate gateway to redirect request, I need to solve this using minimum additional infrastructure dependencies, so if there is a way to do this only by configuring tomcat I'd be really happy.

For example: I want webapp_1 to be accessible only from {topmcat_host}:{port1} and webapp_2 only from {topmcat_host}:{port2}

Thanks.

Community
  • 1
  • 1
Eugene Loy
  • 12,224
  • 8
  • 53
  • 79
  • This might help: - http://stackoverflow.com/questions/8823290/how-to-run-different-apps-on-single-tomcat-instance-behind-different-ports Also found some info: - http://www.coderanch.com/t/556239/Tomcat/Multiple-webapps-different-ports - http://www.coderanch.com/t/87406/Tomcat/Different-webapps-same-instance-tomcat – Paulius Matulionis Nov 16 '12 at 15:03

1 Answers1

0

There is no configurable way to make Tomcat listen on a requested port in terms of application settings. The most civilized option is, of course, configure all ports in server.xml and switch as necessary.

If you can't do the above, you can write a servlet listener which binds on an arbitrary port and forwards all requests/responsed to/from the "main" port (you can also add request validation only to allow requests for this app). But this is an insane solution.

mindas
  • 26,463
  • 15
  • 97
  • 154