You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/07/17 18:34:56 UTC

DO NOT REPLY [Bug 45420] New: mod_proxy_ajp url handling

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

           Summary: mod_proxy_ajp url handling
           Product: Apache httpd-2
           Version: 2.2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: david@reliablehosting.com


Apache 2.2.9 with worker mpm on linux 2.6


When mod_proxy_ajp is used as follows,

ProxyPass / ajp://localhost:8009/test/
ProxyPassReverse / ajp://localhost:8009/test/

requests to page http://domain.com/index.jsp gets rewritten to
http://domain.com/test/index.jsp

When mod_proxy_http is used as follows,

ProxyPass / http://localhost:8009/test/
ProxyPassReverse / http://localhost:8009/test/

requests to page http://domain.com/index.jsp get correctly rewritten to
http://domain.com/index.jsp in the /test/ folder on the tomcat server.

mod_proxy_ajp is incorrectly adding the "test" folder on the proxy url to the
user's request.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45420] mod_proxy_ajp url handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45420


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO




--- Comment #3 from Ruediger Pluem <rp...@apache.org>  2008-07-17 13:41:57 PST ---
Please set the loglevel to debug and post the error log of a faulty request
with ajp.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45420] mod_proxy_ajp url handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45420


David Edwards <da...@reliablehosting.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




--- Comment #2 from David Edwards <da...@reliablehosting.com>  2008-07-17 13:12:49 PST ---
So I did not have ProxyPassReverse listed correctly, that does not change the
different behavior I see between mod_proxy_ajp and mod_proxy_http

Using the http connector
ProxyPass / http://localhost:8009/test/
a request to http://domain.com/index.jsp goes correctly to
http://localhost:8009/test/index.jsp

If the ajp connector is used
ProxyPass / ajp://localhost:8009/test/

a request to http://domain.com/index.jsp goes to
http://localhost:8009/test/test/index.jsp
which is not the expected behavior.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45420] mod_proxy_ajp url handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45420


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Ruediger Pluem <rp...@apache.org>  2008-07-17 12:01:02 PST ---
1. Bugzilla is not user support forum, but for reporting bugs. So please the
user support mailing list (http://httpd.apache.org/lists.html#http-users).
2. Your ProxyPassReverse directive in the ajp case is wrong.
It must be ProxyPassReverse / http://localhost:8009/test/


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45420] mod_proxy_ajp url handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45420


David Edwards <da...@reliablehosting.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




--- Comment #4 from David Edwards <da...@reliablehosting.com>  2008-07-17 16:39:12 PST ---
The debug log below was for the following two directives set in a VirtualHost

ProxyPass / ajp://localhost:8009/test/
ProxyPassReverse / http://localhost:8009/test/

ajp_unmarshal_response: Header[1] [Location] entry appears to be where the
original URL is being altered and /test/ added to it. The URL should either be
http://devsite.local/index.jsp or ajp://localhost:8009/test/index.jsp


[Thu Jul 17 15:54:13 2008] [debug] proxy_util.c(1854): proxy: grabbed
scoreboard slot 2 in child 2574 for worker ajp://localhost:8009/test/
[Thu Jul 17 15:54:13 2008] [debug] proxy_util.c(1950): proxy: initialized
worker 2 in child 2574 for (localhost) min=0 max=25 smax=25
[Thu Jul 17 15:54:13 2008] [debug] proxy_util.c(1854): proxy: grabbed
scoreboard slot 2 in child 2576 for worker ajp://localhost:8009/test/
[Thu Jul 17 15:54:13 2008] [debug] proxy_util.c(1873): proxy: worker
ajp://localhost:8009/test/ already initialized
[Thu Jul 17 15:54:13 2008] [debug] proxy_util.c(1950): proxy: initialized
worker 2 in child 2576 for (localhost) min=0 max=25 smax=25
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(45): proxy: AJP:
canonicalising URL //localhost:8009/test/
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(1488): [client 192.168.1.157]
proxy: ajp: found worker ajp://localhost:8009/test/ for
ajp://localhost:8009/test/
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy.c(966): Running scheme ajp handler
(attempt 0)
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_http.c(1899): proxy: HTTP:
declining URL ajp://localhost:8009/test/
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(579): proxy: AJP: serving
URL ajp://localhost:8009/test/
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2044): proxy: AJP: has acquired
connection for (localhost)
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2102): proxy: connecting
ajp://localhost:8009/test/ to localhost:8009
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2195): proxy: connected /test/
to localhost:8009
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2347): proxy: AJP: fam 2 socket
created to connect to localhost
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(224): Into
ajp_marshal_into_msgb
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[0] [Host] = [devsite.local]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[1] [User-Agent] = [Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[2] [Accept] =
[text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[3] [Accept-Language] = [en-us,en;q=0.5]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[4] [Accept-Encoding] = [gzip,deflate]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[5] [Accept-Charset] = [ISO-8859-1,utf-8;q=0.7,*;q=0.7]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[6] [Keep-Alive] = [300]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[7] [Connection] = [keep-alive]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(430): ajp_marshal_into_msgb:
Done
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(239): proxy:
APR_BUCKET_IS_EOS
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(244): proxy: data to read
(max 8186 at 4)
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(259): proxy: got 0 bytes of
data
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(652): ajp_read_header:
ajp_ilink_received 04
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(662): ajp_parse_type: got 04
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(491): ajp_unmarshal_response:
status = 302
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(502): ajp_unmarshal_response:
Number of headers is = 3
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[0] [Set-Cookie] = [JSESSIONID=9D894ECC78168E1915FC9EAB08CDEF32.worker2;
Path=/test]
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(1071): ppr: real:
http://localhost:8009/test/
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[1] [Location] =
[http://devsite.local/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[2] [Content-Length] = [0]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(652): ajp_read_header:
ajp_ilink_received 05
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(662): ajp_parse_type: got 05
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(498): proxy: got response
from (null) (localhost)
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2062): proxy: AJP: has released
connection for (localhost)
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(45): proxy: AJP:
canonicalising URL
//localhost:8009/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(1488): [client 192.168.1.157]
proxy: ajp: found worker ajp://localhost:8009/test/ for
ajp://localhost:8009/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy.c(966): Running scheme ajp handler
(attempt 0)
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_http.c(1899): proxy: HTTP:
declining URL
ajp://localhost:8009/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(579): proxy: AJP: serving
URL
ajp://localhost:8009/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2044): proxy: AJP: has acquired
connection for (localhost)
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2102): proxy: connecting
ajp://localhost:8009/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2
to localhost:8009
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2195): proxy: connected
/test/test/index.jsp;jsessionid=9D894ECC78168E1915FC9EAB08CDEF32.worker2 to
localhost:8009
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(224): Into
ajp_marshal_into_msgb
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[0] [Host] = [devsite.local]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[1] [User-Agent] = User-Agent] = [Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[2] [Accept] =
[text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[3] [Accept-Language] = [en-us,en;q=0.5]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[4] [Accept-Encoding] = [gzip,deflate]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[5] [Accept-Charset] = [ISO-8859-1,utf-8;q=0.7,*;q=0.7]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[6] [Keep-Alive] = [300]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[7] [Connection] = [keep-alive]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[8] [Cookie] = [JSESSIONID=9D894ECC78168E1915FC9EAB08CDEF32.worker2]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(430): ajp_marshal_into_msgb:
Done
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(239): proxy:
APR_BUCKET_IS_EOS
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(244): proxy: data to read
(max 8186 at 4)
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(259): proxy: got 0 bytes of
data
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(652): ajp_read_header:
ajp_ilink_received 04
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(662): ajp_parse_type: got 04
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(491): ajp_unmarshal_response:
status = 200
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(502): ajp_unmarshal_response:
Number of headers is = 5
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[0] [Pragma] = [No-cache]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[1] [Cache-Control] = [no-cache]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[2] [Expires] = [Thu, 01 Jan 1970 02:00:00 SAST]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[3] [Content-Type] = [text/html]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(574): ajp_unmarshal_response:
ap_set_content_type done
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(564): ajp_unmarshal_response:
Header[4] [Content-Length] = [1950]
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(652): ajp_read_header:
ajp_ilink_received 03
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(662): ajp_parse_type: got 03
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(652): ajp_read_header:
ajp_ilink_received 05
[Thu Jul 17 15:54:21 2008] [debug] ajp_header.c(662): ajp_parse_type: got 05
[Thu Jul 17 15:54:21 2008] [debug] mod_proxy_ajp.c(498): proxy: got response
from 216.131.96.102:8009 (localhost)
[Thu Jul 17 15:54:21 2008] [debug] proxy_util.c(2062): proxy: AJP: has released
connection for (localhost)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45420] mod_proxy_ajp url handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45420


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #5 from Ruediger Pluem <rp...@apache.org>  2008-07-18 02:09:10 PST ---
As I suspected this is a configuration issue and not a bug. Please use

ProxyPassReverse / http://devsite.local/test/

to get this right. As mentioned before Bugzilla is no user support forum but a
bug reporting tool. So please try the users mailing list first when you
encounter such problems.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org