Restarting Tomcat from Tomcat itself

Is it possible to restart Tomcat6 by executing JSP?

This is because I would like to deploy the changes to the application by executing it remotely using a web server.

The deployment script is written in bash and it checks for the latest version from svn, then packs it as war, then copies it to /webapps/

when adding some libraries. If I execute it from JSP (for example using System.execute(..)

, will it cause problems?

The point is that the script itself matters:

/etc/init.d/tomcat6 stop
# do things
/etc/init.d/tomcat6 start

      

so I don't think it will work. Is there a way to run a standalone process from within tomcat?

+2


a source to share


3 answers


You can execute the script using a button on jsp. The only problem that can arise is the end user accessing the page and shutting down your server.



+1


a source


You can use some kind of Continuous Integration Server like Hudson - it is possible to do whatever you said (check from svn, prepare war) and then deploy the application to any Tomcat instance. But for deployment, you need to add tomcat manager app as web app for your tomcat.



+1


a source


You can only shutdown the tomcat instance by sending the shutdown password defined in the default server.xml file, SHUTDOWN to 8005.

0


a source







All Articles