Turn off the default ports not used in Tomcat

The port used to remotely close tomcat is opened by default in the tomcat server.xml configuration file

<Server port="8005" shutdown="SHUTDOWN">

The meaning of the above configuration is to open port 8005 and use the "SHUTDOWN" command to close tomcat.

Connect to port 8005 via telnet, and then send "SHUTDOWN" to close tomcat~

If multiple tomcats need to be deployed on a server, in order to avoid port conflicts, we must modify them to ensure that they are unique, and for old versions of tomcat, three ports are opened by default: 8005 (shutdown), 8009 (AJP protocol connection) Adapter) and 8080 (HTTP protocol connector) [AJP connector is not enabled by default in the new version].

In fact, the default ports of 8005 and 8009 are rarely used, and may cause unnecessary security loopholes, so we need to turn them off.

For AJP, just comment it out, for example

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />
    -->

For the shutdown port 8005, you only need to change it to "-1", for example:

<Server port="-1" shutdown="SHUTDOWN">

When let, remember to restart after modification~

Guess you like

Origin blog.51cto.com/dengshuangfu/2555629