1

I already switched my default port from 8080 to 80, but here's a problem: I need to also be able to manage port 8000, too. Current ports are: 8080, 80. How do I map a new port (8000) to a new webapp?

crownusa
  • 23
  • 1
  • 2
  • 4

3 Answers3

3

You can setup Tomcat so that it will listen on multiple ports, without having to setup 2 instances, simply edit the conf/server.xml configuration file and add a new connector for the port you want. For example if you have a connector like that:

<Connector port="80" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       redirectPort="8443" 
       URIEncoding="UTF-8" />

Add this to that file as well:

<Connector port="8000" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       redirectPort="8443" 
       URIEncoding="UTF-8" />

Make sure it's redirected to the appropriate location.

References

slm
  • 7,355
  • 16
  • 54
  • 72
2

Create separate Service entries for each app and specify Connectors in there with different ports.

This has been addressed:

https://stackoverflow.com/questions/4366843/how-to-deploy-mutiple-web-application-in-tomcat-which-will-run-on-different-port

quadruplebucky
  • 5,041
  • 18
  • 23
0

You run Tomcat twice, one with port 80 and once with port 8000 config, each with their own web app.

ETL
  • 6,443
  • 1
  • 26
  • 47