#在conf/server.xml有以下内容
8005是Tomcat的管理端口,默认监听在127.0.0.1上。无需验证就可发送SHUTDOWN(大小写敏感)这个字符串,Tomcat接收到后就会关闭此Server。
此管理功能建议禁用,可将SHUTDOWN改为一串猜不出的字符串实现
或者port修改成 0,会使用随机端口,如:36913
port设为-1等无效端口,将关闭此功能
此行不能被注释,否则无法启动Tomcat服务
[root@centos8 tomcat]#pwd /usr/local/tomcat [root@centos8 tomcat]#ss -ntl State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 128 [::]:22 [::]:* LISTEN 0 5 [::1]:631 [::]:* LISTEN 0 100 [::1]:25 [::]:* LISTEN 0 1 [::ffff:127.0.0.1]:8005 *:* LISTEN 0 128 [::]:45835 [::]:* LISTEN 0 128 [::]:111 [::]:* LISTEN 0 100 *:8080 *:* [root@centos8 tomcat]#vim conf/server.xml #port设为-1等无效端口,将关闭此功能[root@centos8 tomcat]#systemctl restart tomcat [root@centos8 tomcat]#ss -ntl State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 128 [::]:22 [::]:* LISTEN 0 5 [::1]:631 [::]:* LISTEN 0 100 [::1]:25 [::]:* LISTEN 0 128 [::]:45835 [::]:* LISTEN 0 128 [::]:111 [::]:* LISTEN 0 100 *:8080 *:*



