Hi, Any help to identify and correct what is the issue in my setting to re-write the 500 error by Apache Proxy 2.4.25
Regards, Vel ---------- Forwarded message ---------- From: "Velmurugan Dhakshnamoorthy" <[email protected]> Date: Apr 18, 2017 16:03 Subject: Re: [users@httpd] Reg: Custom error message at Apache 2.4.25 To: <[email protected]> Cc: Hi Luca, > Is it possible to pinpoint what is the wrong in my setting. I am still > unable to display the custom error message. > > *The actual message from weblogic 12c in browser* > > Error 500--Internal Server Error > From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: > 10.5.1 500 Internal Server Error > The server encountered an unexpected condition which prevented it from > fulfilling the request. > > *Apache Proxy 2.4.25 setting in httpd.conf* > > *Configuration to forward request from Apache to Weblogic 12c* > <VirtualHost *:8060> > <Location /> > SetHandler weblogic-handler > WebLogicHost hawley760 > WebLogicPort 8062 > Debug ON > WLLogFile /opt/app/bea/apache2.4/httpd-2.4.25/logs/RPS-8060.log > </Location> > </VirtualHost> > > *config related to error document in httpd.conf* > > DocumentRoot "/opt/app/bea/apache2.4/httpd-2.4.25/htdocs" > ProxyPreserveHost On > ProxyPass /error ! > ProxyErrorOverride On > Alias /error /opt/app/bea/apache2.4/httpd-2.4.25/htdocs > ErrorDocument 500 /error/500.html > > I tried to setup this in virtual host as well, but cannot re-write the > default 500 error message. I am also attaching my httpd.conf file. > > Appreciate if you can tell me what I am doing wrong, it would be much > appreciated. > > Regards, > Vel > > > > > > > Regards, > Velmurugan Dhakshnamoorthy (Vel) > Singapore. > > On Tue, Apr 18, 2017 at 6:56 AM, Velmurugan Dhakshnamoorthy < > [email protected]> wrote: > >> Thanks again for your valuable inputs, I am actually restricting number >> of HTTP sessions at weblogic layer, beyond the specified limit, weblogic >> throws 500 error message, which is not very useful to users, I want only >> the 500 error page to be re-written by Apache proxy with simple message >> (ex: server is busy, login after sometime), I want only 500 generic error >> message to re-write, I don't want to re-write any other content from >> back-end server. >> >> Regards, >> Vel >> >> On Apr 18, 2017 00:19, "Luca Toscano" <[email protected]> wrote: >> >>> Hi! >>> >>> As Nick mentioned there are a couple of options: >>> >>> 1) https://httpd.apache.org/docs/2.4/mod/mod_substitute.html or >>> https://httpd.apache.org/docs/current/mod/mod_proxy_html.html in case >>> you want to replace some parts of the response coming from the backend with >>> your content. >>> >>> 2) Write your own content output filter to modify the backend response >>> as you wish before flushing it out to the client. I'd suggest to follow >>> https://httpd.apache.org/docs/2.4/mod/mod_lua.html#modifying_buckets if >>> you want to attempt this road since using Lua instead of C is generally >>> easier for people not used to write Apache code. >>> >>> My personal suggestion is to not use any of the above but to re-think >>> about why you want to force the proxy to do this work. A proxy should be as >>> lightweight as possible and ideally should mask backend failures with >>> pre-defined error pages. >>> >>> Hope that helps! >>> >>> Luca >>> >>> 2017-04-17 9:57 GMT+02:00 Velmurugan Dhakshnamoorthy <[email protected] >>> >: >>> >>>> Hi Nick, >>>> yes exactly, I want the error message produced by back-end weblogic >>>> server to be re-written by Apache proxy and then display custom message to >>>> user. >>>> >>>> Regards, >>>> Vel >>>> >>>> >>>> On Apr 17, 2017 15:34, "Nick Kew" <[email protected]> wrote: >>>> >>>> On Mon, 2017-04-17 at 09:04 +0800, Velmurugan Dhakshnamoorthy wrote: >>>> >>>> > >>>> > Thanks Luca, I tried setting proxyerroroverride and error >>>> > document in virtual host, however, the 500 error produced by >>>> > content server is displayed as it is via Apache proxy. Any >>>> > further help? >>>> >>>> Are you saying you want an error message coming from the backend >>>> but modified by the proxy? That would imply using a content filter >>>> (such as mod_proxy_html, mod_sed, or mod_substitute) to rewrite >>>> the response from the backend. >>>> >>>> -- >>>> Nick Kew >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >>>> >>> >
httpd.conf
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
