Re: How to handle "Internal Server Error"
jancha <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi. 1) "Internal Server Error" - you get such error displayed if the underlying program crashes for whatever reason. 2) Typically, if there are more than 3 crashes in 30secs, FastCGI puts a 600second delay before launching a new process. Theoretically, you can patch the fastcgi apache module. No other workaround for this. 3) You can make a custom page for 503 error that's shown instead of the ugly "Internal Server Error" page. 4) I strongly suggest fixing the underlying program. Perhaps, you can make up custom signal handlers for your program. E.g. make your own segfault handler. Also, you'll get 503 error if the underlying program does not return valid headers. hope this helps a bit. On Wednesday 27 July 2005 14:53, Jack wrote: > Hello all, > > I'm using Apache2 and mod_fastcgi. I have a fcgi app that > runs well most of the time. Sometimes an error occurs in the > fcgi code and Apache renders a page that says "Internal Server > Error". At the bottom, it displays the installed modules such > as fcgi, etc. In some cases, it's because the fcgi module crashed > and failed to output the page. Apache will restart the fcgi process > upon another request. However, in some other cases, another request > doesn't fix it. It seems that the process was still running, although > I didn't check. That's my guess because I had to restart Apache to > restore it. Apache and mod_fastcgi worked fine with other fcgi modules > when this happened so the only reason is that cgi process. > > So my question is, how to handle the two scenarios of "Internal > Service Error"? > > In the first scenario, when it happens it's ugly but the next request > will be ok because a new fcgi process will be started. I'd like > to know if there is a way to intercept that "internal server error" > page and replace it with my own page which looks better? > > And in the second scenario, how to detect it when it happens, and what is > the best approach to restore the service? Restart Apache will affect > all clients, including those not using this fcgi module. Or, find > all processes of the fcgi app and kill them all and let Apache restart > them on new requests? Or, is there a way to find out which particular > process has a problem and only kill that one? > > I know the best way is to fix the bug... :) ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/