On 06.05.2016 07:01, Jerry Malcolm wrote:
On 5/5/2016 2:05 PM, David kerber wrote:
On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
I am not using WAR files for my apps.  I simply copy updated files to
the image in \webapps as changes/updates are required.  I have a server
running on my local dev machine.  When I refresh any webapp file (jars,
jsps, etc) the server detects the changes, refreshes, and everything is
good with the new versions running without further intervention.
However, when I do the exact same thing to my remote server (which is an
identical mirror of the local TC) almost every time there is a refresh,
the server webapp stops, and I have to go the manager and restart all of
the web apps.

I'm suspecting that it might have something to do with the upload
speed.  Where I can pretty much instantly replace a jar file locally, it
may take several seconds to replace the same jar file on the remote
machine due to connection speed to the server.  And I assume TC is ok
with 'instant' jar replacements, but doesn't like it when it takes too
long for a jar to finish updating.

Whatever the cause, I've resigned myself to the fact that I'm going to
have to restart the webapps after every upload.  But I'd love to figure
out a way to do that automatically (preferably as part of my ant 'build'
script).  A full refresh can take 20-30 minutes (I have lots of large
web apps...).  I have to wait around for the upload to complete, else
the server will be down until I can come back and around and refresh.

So, is there a way to bounce an entire host programatically at the end
of the upload?  Or is there a way to remotely via a script to bounce all
of the webapps?

I believe the Manager app can force a reload of your webapps, though I never 
use it.

But what about this, to make the process more closely mirror what you see 
locally:
Upload the updated files to a temporary holding spot on the remote server, and 
then
after they're all there, move them en-mass to the webapps directory.  That 
final copy
will be very fast, and would likely allow the server to pick up the changes 
just like it
does locally.

Thanks for the info.  I had thought about the option of caching on the server 
and doing a
fast copy.  But that will still require code on the server to execute the copy 
from the
cache, and somehow the server code will need to be triggered by the 
build/upload process
on the build machine or otherwise I have to log onto the server desktop and run 
it
manually.  My build/upload process is totally automated using ant except for 
this one
nagging issue with the webapps.

The manager has the web interface to restart the web apps.  But I have 20 web 
apps.  And
the manager makes me start each web app one at a time and wait for the page to 
reload
before going to next app. Cumbersome at best.


The Manager also has a "program-friendly text interface", see :
http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Configuring_Manager_Application_Access
--> List Currently Deployed Applications  (e.g.)
So, at the least, you could write some simple script which could trigger this 
remotely.
A scripting language like Perl or Python would be ideal for that kind of thing.
Just make sure that you properly secure the access to the Manager app.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to