Ajay Kumar
Ajay Kumar

Reputation: 11

How to stop tomcat server safely when shutdown port is -1

As per tomcat security documentation I have disabled tomcat shutdown port due to security concerns.

https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Server

Now I am unable to shutdown tomat using shutdown.bat/shutdown.sh.

Can anyone help me with script or command to stop tomcat server safey if shutdown port is disabled?

Upvotes: 1

Views: 2607

Answers (1)

mturra
mturra

Reputation: 660

On linux: catalina.sh the script try to shutdown tomcat gracefully calling

org.apache.catalina.startup.Bootstrap stop

This try calling shutdown command on shutdown port configured server.xml

If it not succeed it will try with kill command.

On Windows: the start/stop is done by service and don't use the shutdown port. If you use startup.bat and shutdown.bat (not recommended in production), the shutdown will not work with shutdown port disabled (-1)

Upvotes: 2

Related Questions