I have a server running many JAVA application's with tomcat 6.0.18, i need to know how can i scheduele a shutdown of just 'X' application and keep other's running.

I'll appreciate your ideas



Take a look at this: http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Supported%20Manager%20Commands

or move your mouse to the "Stop" link on the Tomcat Manager Web UI, and look at the status bar you will see the URL to stop that app. You can call it with a script via wget, curl, lynx, ...

  • +1 for saying to use wget/curl… – Donal Fellows Jun 10 '11 at 10:13

Access Tomcat Manager via URL http://ip:8080/manager, you will see a list of running applications. And from this, you can stop any webapp which you want.

  • @quanta : thanks for your reply, i know that i can shutdown an apps from tomcat manager console but my request is how can i schedule it thank you again – ME-KJ May 30 '11 at 10:15
  • If you are running Tomcat on Linux, you can kill it by getting the PID from the port which your app is running: netstat -nlp | grep java | grep :port | awk '{ print $7 }' | awk -F "/" '{ print $1 }' – quanta May 30 '11 at 10:53
  • RE, my tomcat is using 4519 ports for all apps and i want just shutdown X apps not all tomcat apps thanks – ME-KJ May 30 '11 at 11:02
  • Did you try to kill it based on the app name? – quanta May 30 '11 at 13:00
  • no how can i do that? tks – ME-KJ May 30 '11 at 14:41

I use wget to stop et start applications the user in tomcat-user.xml must have manager-script roles For TOMCAT 5,6:

wget "http://<user>:<password>@<servername>:<port>/manager/stop?=/<application context>" -O - -q
wget "http://<user>:<password>@<servername>:<port>/manager/start?=/<application context>" -O - -q

Since TOMCAT 7 (7.0.62 for my installation) you have to add /text/ after manager:

wget "http://<user>:<password>@<servername>:<port>/manager/text/stop?=/<application context>" -O - -q
wget "http://<user>:<password>@<servername>:<port>/manager/text/start?=/<application context>" -O - -q

Hope it's helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.