Hi Len,
   On your comments, I totally understand that you can't override the tomcat
503 error page in a standalone Tomcat set up, especially from a webapp that
isn't running. However, can you explain ...

> As long as Tomcat is running, the situation is the same as above. 
> JK and Apache pass Tomcat's error pages and status codes back 
> unchanged.  ErrorDocument declarations do not override Tomcat's 
> error pages.

I don't understand why Apache can't override it if it has the right status
code, isn't that the whole point of having a status code handler in
httpd.conf?  Just seems that if Apache can handle the 503 with Tomcat down,
that it shouldn't work any different with Tomcat running but with a webapp
down, as long as if its returning the same status code.

Thank you much for your feedback, 

Rick

-----Original Message-----
From: Len Popp [mailto:[EMAIL PROTECTED] 
Posted At: Tuesday, July 25, 2006 6:26 PM
Posted To: Tomcat Dev
Conversation: Possible to send 503 status over JK?
Subject: Re: Possible to send 503 status over JK?


The recent messages on this topic have confused me, so I've spent part of my
evening running some tests.
=========
First, with Tomcat standalone:

Tomcat's default error pages can be overridden by an error-page declaration
in the webapp's web.xml. If there is no error-page declared, Tomcat uses its
default error page; it does *not* fall back to a "global" error page
declared in the ROOT webapp.

When a webapp is stopped, its error pages are not executed (obviously), so
Tomcat's default error pages are used.

Therefore it is not possible to override the 503 page when the webapp is
stopped. Tomcat always uses its default page.

In any case, the correct HTTP status code is returned to the browser.
=========
With Tomcat behind Apache and mod_jk:

As long as Tomcat is running, the situation is the same as above. JK and
Apache pass Tomcat's error pages and status codes back unchanged.
ErrorDocument declarations do not override Tomcat's error pages.

When Tomcat is down (not just one webapp stopped, but Tomcat not running at
all), you obviously don't get a Tomcat error page. Apache generates the 503
error and uses its own error page. This page can be overridden by
ErrorDocument.

Again, the correct HTTP status codes are returned to the browser.

So, you can use a custom ErrorDocument to return a "Site Down" message if
Tomcat is down completely, but not if a webapp inside Tomcat is stopped.

These tests were done with Tomcat 5.5.17, Apache 2.0.55, JK 1.2.15.
--
Len

On 7/25/06, Hassan Schroeder <[EMAIL PROTECTED]> wrote:
> On 7/25/06, Rick G <[EMAIL PROTECTED]> wrote:
>
> > The 500 is caught correctly, but I always end up seeing the tomcat 
> > generated error page for a 503.
> > I guess this could be a mod_jk or apache issue if you are saying 
> > that tomcat is sending the right status code.
> >
> > Questions:
> >  what version of tomcat you running?
>
> that quick test was on 5.5.17 standalone just to confirm the correct 
> http header was being sent.
>
> --
> Hassan Schroeder ------------------------ [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to