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.25Regards,Vel---------- Forwarded message ----------
From: "Velmurugan Dhakshnamoorthy" <dvel.hex@xxxxxxxxx>
Date: Apr 18, 2017 16:03
Subject: Re: [users@httpd] Reg: Custom error message at Apache 2.4.25
To: <users@xxxxxxxxxxxxxxxx>
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 browserError 500--Internal Server ErrorFrom 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.confConfiguration 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.confDocumentRoot "/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.htmlI 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 <dvel.hex@xxxxxxxxx> 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,VelOn Apr 18, 2017 00:19, "Luca Toscano" <toscano.luca@xxxxxxxxx> 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. in case you want to replace some parts of the response coming from the backend with your content.html 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#mo if you want to attempt this road since using Lua instead of C is generally easier for people not used to write Apache code.difying_buckets 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!Luca2017-04-17 9:57 GMT+02:00 Velmurugan Dhakshnamoorthy <dvel.hex@xxxxxxxxx>: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,VelOn Apr 17, 2017 15:34, "Nick Kew" <niq@xxxxxxxxxx> wrote:On Mon, 2017-04-17 at 09:04 +0800, Velmurugan Dhakshnamoorthy wrote:Are you saying you want an error message coming from the backend
>
> 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?
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: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
------------------------------------------------------------ ---------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx