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

            Bug ID: 56264
           Summary: Confusing error with .htaccess rewrite to proxy when
                    mod_proxy not active.
           Product: Apache httpd-2
           Version: 2.4.7
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: mod_rewrite
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 31387
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31387&action=edit
Patch File

When a rewrite to proxy is configured in the server config, a check is made to
make sure mod_proxy is active.  But the same is not done if a rewrite to proxy
is configured in an .htaccess file.  This can produce a misleading error.

Steps to Reproduce:
1) Disabe mod_proxy.
2) Add a RewriteRule to an .htaccess file that uses mod_proxy (i.e.):
RewriteRule . http://www.mydom.com/index.html [P,L]
3) Go to a browser and try to load the site with the .htaccess file.

Actual Results: The error_log will show an error like this:
[Fri Mar 14 11:53:20.226288 2014] [core:error] [pid 6449] (2)No such file or
directory: [client 192.168.2.4:32811] AH00132: file permissions deny server
access: proxy:http://www.mydom.com/index.html

Expected Results:
[Fri Mar 14 12:02:05.964263 2014] [rewrite:error] [pid 6592] [client
192.168.2.4:32816] AH00669: attempt to make remote request from mod_rewrite
without proxy enabled: proxy:http://www.mydom.com/index.html

I believe this same issue would be on all hardware/operating systems, but in
case it matters, this was tested on: CentOS 6.5 x86_64, Apache 2.4.7,
apr-1.5.0, apr-util-1.5.3.

The attached patch file for the 2.4.7 version of mod_rewrite.c fixes it for me.
 Basically it is the block of code from hook_uri2file that does the proxy
check, copied to hook_fixup.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to