开发者

Restarting Tomcat from Tomcat itself

开发者 https://www.devze.com 2022-12-29 20:38 出处:网络
is it possible to restart Tomcat6 by executing a JSP? This because I would like to deploy the changes of an application by doing it remotely using the webserver.

is it possible to restart Tomcat6 by executing a JSP?

This because I would like to deploy the changes of an application by doing it remotely using the webserver.

The deploy script is written in bash and it checkouts the latest version from the svn, then package it as a war, then copy it in /webapps/ while adding some libs. If I execute it from a JSP (for example by using System.execute(..) will it cause problems?

The fact is that the script its开发者_JAVA技巧elf is something like:

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

so I don't think it would work.. is there a way to execute a stand-alone process from inside tomcat?


You should be able to execute a script from a button click on a jsp. The only problem it may cause is an end-user accessing the page and shutting down your server.


You may use some Continous integration server, like Hudson - it is possible to perform all you said (checkout from svn, prepare war) and then deploy the application to any Tomcat instance. But for deploying you'll need to add tomcat manager application as web-app to your tomcat.


You can only shutdown the tomcat instance sending your shutdown password defined in the server.xml default it's SHUTDOWN on 8005.

0

精彩评论

暂无评论...
验证码 换一张
取 消