Hello,

I'm using Tomcat 5.5 + Apache 2 + mod_jk and the Tomcat Ant tasks to
deploy my applications via the Tomcat Manager. I want the Apache to
display a maintenance message during re-deployments.

When the application is undeployed, everything works fine. Tomcat sends
a 503 error code and Apache displays the custom error document. Now,
when the upload of the new WAR file begins, Tomcat responds with 400
(Bad Request) until the application is up and running.

Unfortunately Apache doesn't allow you to specify a custom error
document for 400. Quote from the Apache documentation:

Although most error messages can be overriden, there are certain circumstances where the internal messages are used regardless of the setting of ErrorDocument||. In particular, if a malformed request is detected, normal request processing will be immediately halted and the internal error message returned. This is necessary to guard against security problems caused by bad requests.
(See: http://httpd.apache.org/docs/2.0/mod/core.html#errordocument)

The 400 code is sent by the StandardEngineValve if no matching host is
found. This topic was discussed on this list earlier this year:
http://marc.theaimsgroup.com/?l=tomcat-user&m=114183887606248&w=2

This is what RFC 2616 (10.4.1) says about status code 400:

The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

The thing is, that there's nothing wrong with the client's request, at
least it's not a syntactical issue. So wouldn't a 404 or 500 be more
appropriate here?

However, in my case it would be the best if Tomcat was aware of the fact
that the application is redeployed and would continue to respond with a
503 status code.

Does anybody else have this problem and is there possibly any way to
solve this by means of configuration?

Best regards,
-Felix


---------------------------------------------------------------------
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