Are there any preferred alternative ports for Tomcat installations?

The default port for Tomcat (and other "secondary" web servers / servlet containers) is 8080.

If multiple services are configured for this port, or you need to install multiple Tomcat instances on the server, you can change this port value in $ {CATALINA_HOME} /conf/server.xml.

Is there a standard for specifying port numbers that other installations should use? Is there a standard approach + 1 / + 10 / + 100 / + 1000 that is usually followed? Is there a way to determine if there are conflicts without choosing something and just trying to do it?

Also, in server.xml by default:

<Server port="8005" shutdown="SHUTDOWN"> <Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> 

For additional Tomcat installations, should all of them be renumbered / included? Should they follow the same renumbering strategy?

+4
source share
3 answers

Is there a way to determine if there are conflicts without choosing something and just try?

The latest version of Tomcat 7.0.25 includes automatic search and bind to a free port. This is not very convenient for any production installation, but rather neat for testing and development purposes.

To answer your initial question, I really like 9090 when 8080 is issued, but I donโ€™t know of any specific best practices in this area.

Tomcat docs describing auto port binding are here .

And yes, all other ports must also be changed.

+5
source

If you associate several cats with the same IP address, you will need to use different ports on the connectors and set them manually in the server.xml file.

I always used +1 by individual agreement.

+2
source

I really like the +10000 approach. Although there are well-known services that go beyond port 10000 by default, many well-known applications do not. Therefore, additional ports are quite recognizable.

For instance:

  • Tomcats: 8080, 18080, 28080
  • Protected Tomcats: 8443, 18443, 28443
  • ISCSI Objectives: 3260, 13260, 23260

... etc.

+1
source

Source: https://habr.com/ru/post/1396296/


All Articles