Bug 694939

Summary: mod_proxy_ajp does not honor "ProxyErrorOverride"
Product: Red Hat Enterprise Linux 6 Reporter: Neal Kim <nkim>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: prc, syeghiay
Target Milestone: rc   
Target Release: 6.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 15:11:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Original proposed patch from Jim Riggs
none
Patch against httpd-2.2.15-5.el6 src RPM none

Description Neal Kim 2011-04-09 00:01:17 UTC
Description of problem:

"ProxyErrorOverride On" does not work if used with mod_proxy_ajp.

[ Config Snippet ]

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>

ProxyErrorOverride On

<Proxy balancer://ajpCluster>
BalancerMember ajp://somehost1:9324 route=s1 loadfactor=100 retry=10
BalancerMember ajp://somehost2:9324 route=s2 loadfactor=90 retry=10
ProxySet lbmethod=byrequests
ProxySet stickysession=JSESSIONID
</Proxy>

ProxyPass /static balancer://ajpCluster/static
ErrorDocument 404 /index404.html
DocumentRoot "/opt/static/error/"

<Directory /opt/static/eror/>
Order allow,deny
Allow from all
</Directory>

When I access a 404 URL in the /static context, which is proxied with AJP, I get a 404 page from Tomcat. Accessing 404 URLs via non-proxied content works as intended, as defined in "ErrorDocument".

Version-Release number of selected component (if applicable):

httpd-2.2.15-5.el6


How reproducible:

Everytime.


Steps to Reproduce:

1. Define "ErrorDocument"
2. Enable "ProxyErrorOverride"
3. Access 404 URL via definied "ProxyPass" context
  

Actual results:

404 error from backend (proxied) server


Expected results:

404 error as defined in "ErrorDocument" via Apache


Additional info:

Bug originally filed in 2007 via Apache Bugzilla. It looks like this bug has still not been corrected as of the latest upstream version of Apache.

https://issues.apache.org/bugzilla/show_bug.cgi?id=41278

There is a proposed patch but may not be complete (e.g. no special handling of code 401, etc...). Please see comment #1 in the original Apache BZ for more information.

Comment 2 Neal Kim 2011-04-09 00:06:17 UTC
Created attachment 490898 [details]
Original proposed patch from Jim Riggs

Jim Riggs 2009-03-04 20:24:03 EST

Attached is an initial patch that provides this functionality. It may not be complete (e.g. it doesn't do any special handling for 401 like mod_proxy_http
does), and I make no claims to be an expert in the Apache code, so it may not
be complete or 100% correct. That said, though, I have been using this patch
for some time with no issues.

Comment 4 Neal Kim 2011-04-09 00:45:37 UTC
Created attachment 490899 [details]
Patch against httpd-2.2.15-5.el6 src RPM

Comment 5 RHEL Program Management 2011-04-09 06:00:26 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 6 Neal Kim 2011-04-09 07:35:39 UTC
Comment on attachment 490899 [details]
Patch against httpd-2.2.15-5.el6 src RPM

Reversed

Comment 8 Joe Orton 2011-04-27 11:58:16 UTC
There is a fix for this upstream:

http://svn.apache.org/viewvc?rev=1087864&view=rev

Comment 14 errata-xmlrpc 2011-12-06 15:11:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1630.html