Search code examples
tomcatconfigurationwebserverports

Are all tomcat ports needed


I am trying to set up a tomcat server to host a webapp and need to deal with some compliance issues. The main one being that only port 8443 should be open and accept only SSL connections and not 8080 or any of the other ports tomcat uses which are spelled out in its default layout as seen below

  <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

What would happen if I were to change the above to something such as this?

  <Service name="Catalina">
    <Connector port="8443" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Would tomcat still work correctly and just be hosted on port 8443 or would I run into issues with only using port 8443?


Solution

  • It won't make any difference if you are not using a SSL configuration. The redirect port is used to forward to a SSL port. In other words it will work using only port 8443.

    Check the reference below:

    redirectPort: If this Connector is supporting non-SSL requests, and a request is received for which a matching requires SSL transport, Catalina will automatically redirect the request to the port number specified here.