Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat Auto Deploy Feature is this good?

Tags:

tomcat

tomcat6

I downloaded and setup my Apache Tomcat 6 in our production server. I then started it to see if it's running, and found out that its okay.

It runs and then I place my project war file there. I am about to restart the tomcat service when I notice that that my web archive file was already unzipped and my project web file is already set at the web apps folder.

I think, my setup has an auto-deploy feature but I kept on thinking if this is a good thing?

I have these questions in mind:

  1. Does Tomcat really auto deploys web archive file and what is the frequency that it does?
  2. Is this a nice feature?
  3. So what if I leave my war file there, does that mean that Tomcat will reload or unzip the archive file every now and then?
  4. Is what Tomcat does to my war file the same as when I properly restart my tomcat and let the tomcat service deploy my war file?
like image 620
Mark Estrada Avatar asked Oct 19 '10 13:10

Mark Estrada


2 Answers

Have a look at the manual. It says:

If the Host autoDeploy attribute is "true", the Host will attempt to deploy and update web applications dynamically, as needed, for example if a new .WAR is dropped into the appBase

Whether this is a nice feature depends on your requirements. None of the projects I worked on needed this, but hey - your story might be different.

Autodeploy is the same feature as if you would restart Tomcat and it would find a .war sitting around, the only difference is that there has to be a polling thread which looks for changes in the appBase folder.

like image 191
mindas Avatar answered Nov 15 '22 10:11

mindas


Be careful when using this autoDeploy feature. It will first 'undeploy' the application if an existing version exists and it will delete the context configuration file as well ($CATALINA_HOME/conf/[engine-name]/[host-name]/[app-name].xml).

like image 30
n0rm1e Avatar answered Nov 15 '22 11:11

n0rm1e