Filters work great for this.  Also, if you have a cluster, you probably
have a load balancer in front of the cluster. If you do, then you could
have the load balancer direct all your traffic to a server that runs
Apache and only served up a 'Sorry the site is down' page.  When the
site is back up you can redirect the traffic back to the servers. This
will allow you to do maintenance on the DB, Application, Tomcat etc.

Subir

-----Original Message-----
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 16, 2005 12:36 PM
To: Tomcat Users List
Subject: Re: How to do "Downtime" with a Apache/Tomcat webapp

I had a similar requirement in my app... We had a two-hour window per 
day when the app was unavailable because background tasks were 
processing.  The server was still up, and so was the app technically, 
but it was not available.

I wrote a filter to take care of this.  I had a flag in application 
context to tell if the app was up or not too, so that if I had to make 
the app unavailable during a time when it normally was available, I just

set the flag.  I also defined a single user that was still allowed to 
get in (another context parameter).  This works out great.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

Len Popp wrote:
> I've been thinking about the same problem, but I haven't gotten around
to 
> working on it seriously.
>  How about this: Instead of fiddling with the JkMount directives in
Apache, 
> swap the web.xml in your Tomcat app so it points to a minimal servlet
that 
> returns the "Out of service" page for all requests.
>  Does that sound like it would work? It would be less disruptive
because you 
> don't have to restart Apache (if there's more to the web site than the
one 
> Tomcat app). Plus this will work with stand-alone Tomcat.
> 
> On 5/15/05, Richard Mixon (qwest) <[EMAIL PROTECTED]> wrote: 
> 
>>I'm curious how folks handle letting users know that their webapp is
>>down when doing maintenance.
>>
>>We've got a pretty standard setup. Our informational/static site is
>>served by Apache 2.0.x. We use mod_jk to link to a page in our
>>webapplications, triggering CMA for authentication and login. We run
>>Tomcat 5.5.x. Although we actually have Tomcat clustered, there are
>>still times when we need to make the application unavailable. (i.e.
>>doing database schema changes, etc.).
>>
>>I would like for a page to be displayed that says the application is
>>temporarily not available.
>>
>>So, what's the best way to do this?
>>
>>One way I can think of is to modify the JkMount directives so that may
>>context name was not mapped to Tomcat, but instead to a static page -
>>the just do a restart. Trouble is some of our users have bookmarks
into
>>various pages/actions in the application - we would somehow have to
mapp
>>all pages that began with the context name to this single page. This
>>sounds a bit messy.
>>
>>Is there a more straightforward way of doing this?
>>
>>Thank you - Richard
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to