I'm writing a bash script that automatically deploys an application to a tomcat server. How can I stop the application from bash / command line?
To use Task Manager: Open Task Manager, and select More details if not already expanded. Select the Services tab. Locate and select IDM Apps Tomcat Service and right-click, then select Start, Stop, or Restart.
Type in sudo service tomcat7 start and then hit Enter : You will receive the following message indicating the server is started: To stop the Tomcat server, type in sudo service tomcat7 start and then hit Enter in the original terminal window: You will receive a message indicating the Tomcat server has been stopped.
The easiest method I know of is to install the Tomcat manager webapp, note the URL for stopping an application, and wget
that URL.
Try this command-line script for managing tomcat called tomcat-manager. It requires Python, but allows you to do stuff from a Unix shell like:
$ tomcat-manager --user=admin --password=newenglandclamchowder \ > http://localhost:8080/manager/ stop /myapp
and:
$ tomcat-manager --user=admin --password=newenglandclamchowder \ > http://localhost:8080/manager deploy /myapp ~/src/myapp/myapp.war
Because it talks to tomcat over HTTP, it works "locally", i.e. via localhost, or from anywhere your tomcat instance is accessible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With