Forum Moderators: phranque

Message Too Old, No Replies

how to manage error 503

         

bart72

12:03 pm on Jan 27, 2015 (gmt 0)

10+ Year Member



Hello to everybody, I'm new in this forum and I'm new in apache web server!
I would like to redirect all request to my web site when it go down for any reason caused by error 503 of two backend server jboss.
My apache web server is configured to use 2 virtual host (one for my application and another for other application), and my virtual host use proxy balancer directive and proxy pass directive, with 3 context root.

How must I configure apache to redirect all request to custom maintenance page when both of backend server go down so that the end user do not see a error page of service unavailable?

Thanks in advance
Marco

penders

1:56 pm on Jan 27, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...for any reason


Presumably the reason is that you have purposefully decided to take the server offline, rather than some other error condition?

...so that the end user do not see a error page of service unavailable?


If the "service unavailable" page is already the default 503 server page, then maybe all you need is to setup a custom ErrorDocument ...?

ErrorDocument 503 /e503.html

bart72

2:11 pm on Jan 27, 2015 (gmt 0)

10+ Year Member



No, I don't decide to take the server offline:
I wanted to say that in the case where the backend servers go out of memory (for any reason), then the response that will come to the end user will be an error 503 (not available). To prevent this, I would understand if it is possible to configure apache so that in the face of a 503 error may display a static page that indicates to the end user that the site is under maintenance.
Is it possibile and how?

not2easy

3:30 pm on Jan 27, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Your answer was in penders previous post:
Create the page you want people to see and add:
ErrorDocument 503 /e503.html

to your htaccess file so the server will show your custom page (e503.html) when a "503" error happens.

lucy24

8:11 pm on Jan 27, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



in the case where the backend servers go out of memory (for any reason), then the response that will come to the end user will be an error 503 (not available). To prevent this, I would understand if it is possible to configure apache so that in the face of a 503 error may display a static page that indicates to the end user that the site is under maintenance.

I don't understand what you mean by "to prevent this". Conversely, I'm not sure you understand that a numerical error code and a physical page seen by humans are two different things. What you're describing is what most people already have, as in:
ErrorDocument 503 /boilerplate/repairs.html

(pulling a line at random from my htaccess).

A 503 error can be returned intentionally, as when you temporarily close the site for maintenance. But all replies in this thread work on the assumption that a 503 can also happen automatically, when-- to quote the docs--
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.


My question at this point is: If the server is so overloaded that it can't honor requests, will it still be able to serve up a custom error document?