RE: Hooking into core

1999-11-07 Thread Eustace, Glen

Once again, I don't seem to have been very successful in describing my
problem.  I'll try again.

I am using mod_proxy, as a reverse proxy, i.e. so that I can push inbound
requests to a bunch of backend servers.  This works great, as most of you
probably already know, until one of the back end servers dies.  Depending on
the error, this is reported back to the client as either a 500 Proxy Error
or 502 Proxy Error, with a little but not much more info.

It is not possible to use the standard ErrorDocument approach as if one
attempts to use a relative URI ( so that one can use the REDIRECT_*
variables ) one gets a loop because the server isn't there ( thats why we
got an error in the first place ).  If one does an absolute URI, one can not
do anything smart with the page displayed.

I would like to be able to do two things
1. When there is no alternative service, display a nice page with
appropriate content.
2. If the same page can be delivered from one of the other servers,
automatically redirect the request to one of them. i.e. don't show the user
an error message at all.

Any suggestions appreciated.
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Glen Eustace, Systems Engineer - Networking, Computing Services,
Massey University, Private Bag 11222, Palmerston North, N.Z.
Ph: +64 6 350 5161, Fax: +64 6 350 5607, Mobile +64 25 500 321
Pvt Ph: +64 6 356 2562



Re: Hooking into core

1999-01-03 Thread Stas Bekman

> I would like to be able to add to or change the way errors are handled.  I
> am hoping that is possible to somehow create a routine in perl that I can
> get called before or instead of the standard core routine.
> 
> I want to be able to construct a page that contains a more user friendly
> response.  The errors I particularly need to intercept are the 500 and 502
> returned by mod_proxy when an upstream site is unavailable.
> 
> ErrorDocument simply does help as none of the REDIRECT_* vars are available
> when the redirect is absolute, which it has to be for these errors. 

At the PerlAPI/Handlers level read the Eagle book p.166

For runlevel trapping, see:
http://perl.apache.org/guide/porting.html#Redirecting_Errors_to_Client_ins

___
Stas Bekman  mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas  
Perl,CGI,Apache,Linux,Web,Java,PC at  www.singlesheaven.com/stas/TULARC
www.apache.org  & www.perl.com  == www.modperl.com  ||  perl.apache.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com