How to automatically restart Apache service after HTTP 503 error?
Posted
by
Gnanam
on Server Fault
See other posts from Server Fault
or by Gnanam
Published on 2011-02-18T10:40:42Z
Indexed on
2012/11/06
23:04 UTC
Read the original article
Hit count: 285
Our production server is running Apache v2.2.4 on CentOS5.2. Mono v1.2.4 is integrated within Apache.
Recently, we faced a problem in our production server. From Apache's access_log, I found a HTTP 500 internal server error for one of the HTTP request and all subsequent HTTP requests also failed but with HTTP 503 service unavailable error. From thereafter, none of the requests were successful. Also, only later some time, we realized that our application was not working because of this error and then we restarted Apache service.
My questions are,
- in this kind of situation, how do I automatically restart Apache service when HTTP 503 error is encountered? Is there any Apache directive available to set?
- in general, what would cause a HTTP 503 error in Apache?
NOTE: Mono helps in running applications developed in .NET on a Linux-based OS.
EDIT: I agree on finding the root cause of this problem. In fact, we've been analyzing that too. Till we resolve it, am finding whether this could be restarted immediately on its own without having any downtime/service disruption for application users.
© Server Fault or respective owner