Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 85104 invoked from network); 15 Jun 2010 13:04:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Jun 2010 13:04:46 -0000 Received: (qmail 18370 invoked by uid 500); 15 Jun 2010 13:04:40 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 17684 invoked by uid 500); 15 Jun 2010 13:04:37 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 17660 invoked by uid 99); 15 Jun 2010 13:04:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 13:04:36 +0000 X-ASF-Spam-Status: No, hits=-0.9 required=10.0 tests=AWL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 13:04:27 +0000 Received: from localhost (localhost [127.0.0.1]) by tor.combios.es (Postfix) with ESMTP id 159DF226232 for ; Tue, 15 Jun 2010 15:02:42 +0200 (CEST) Received: from tor.combios.es ([127.0.0.1]) by localhost (tor.combios.es [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0hXcOUGf0AHz for ; Tue, 15 Jun 2010 15:02:42 +0200 (CEST) Received: from [192.168.245.129] (p549EA302.dip0.t-ipconnect.de [84.158.163.2]) by tor.combios.es (Postfix) with ESMTPA id A184E2260EF for ; Tue, 15 Jun 2010 15:02:41 +0200 (CEST) Message-ID: <4C177A41.7070801@ice-sa.com> Date: Tue, 15 Jun 2010 15:04:01 +0200 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: RewriteRule rewrites, but mod_jk persists with old URI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi. I have a problem at tbe border between Apache httpd's mod_rewrite and the mod_jk Apache/Tomcat connector. Versions are : Apache httpd 2.2.3 mod_jk 1.2.18 OS : Linux Debian 2.6.18-6-686 #1 SMP Thu May 8 07:34:27 UTC 2008 i686 GNU/Linux (Not the latests versions, I know, but that's what that system has and the problem may not be version-linked, and there is something sweet about packages which just install/upgrade with apt-get) The request URL I am using is http://hostname/jsp/search.jsp In the Apache httpd config, is the following RewriteRule : RewriteCond %{REQUEST_URI} ^/jsp/(.*)$ RewriteRule ^/jsp/ /mir/%1 [PT] OR, more simply (but with the same result at the end) : RewriteRule ^/jsp/(.*)$ /mir/$1 [PT] plus a Location section as follows : SetHandler jakarta-servlet (OR the following, to the same end-effect also : JkMount /mir ajp13 JkMount /mir/* ajp13 ) The above rewrite rule should rewrite /jsp/search.jsp to /mir/search.jsp and it does, as per the mod_rewrite log : [rid#8c06030/initial] (2) init rewrite engine with requested uri /jsp/search.jsp [rid#8c06030/initial] (2) rewrite '/jsp/search.jsp' -> '/mir/search.jsp' [rid#8c06030/initial] (2) forcing '/mir/search.jsp' to get passed through to next API URI-to-filename handler But then, in the mod_jk log, I see this : ... [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] map_uri_to_worker::jk_uri_worker_map.c (508): Attempting to map URI '/mir/search.jsp' from 2 maps [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] map_uri_to_worker::jk_uri_worker_map.c (520): Attempting to map context URI '/mir/*' [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] map_uri_to_worker::jk_uri_worker_map.c (534): Found a wildchar match ajp13 -> /mir/* [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] jk_handler::mod_jk.c (1832): Into handler jakarta-servlet worker=ajp13 r->proxyreq=0 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] wc_get_worker_for_name::jk_worker.c (111): found a worker ajp13 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] init_ws_service::mod_jk.c (531): Service protocol=HTTP/1.1 method=GET host=(null) addrr=84.158.163.2 name=(hostname) port=80 auth=(null) user=(null) laddr=192.168.245.20 raddr=84.158.163.2 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_get_endpoint::jk_ajp_common.c (2172): acquired connection pool slot=0 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (566): ajp marshaling done [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_service::jk_ajp_common.c (1706): processing ajp13 with 2 retries [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (909): sending to ajp13 pos=4 len=424 max=8192 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (909): 0000 12 34 01 A4 02 02 00 08 48 54 54 50 2F 31 2E 31 - .4......HTTP/1.1 [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (909): 0010 00 00 0F 2F 6A 73 70 2F 73 65 61 72 63 68 2E 6A - .../jsp/search.j [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (909): 0020 73 70 00 00 0C 38 34 2E 31 35 38 2E 31 36 33 2E - sp...84.158.163. [Tue Jun 15 11:26:15 2010] [9170:30400] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (909): 0030 32 00 FF FF 00 17 6D 69 72 2E 64 65 76 2E 77 69 - 2.....mir.dev.wi ... In other words, it appears to receive the URI "/mir/search.jsp", try to map it to a worker, succeed, but then forwarding the request to Tomcat as "/jsp/search.jsp" anyway (which was the original URL, not the rewritten one). This "/jsp/search.jsp" is indeed not found by Tomcat (because in Tomcat it is "/mir/search.jsp"), and I receive in return a 404 error page from Tomcat. I have tried umpteen variations for the mapping and the rewrite rule, without success. What am I doing wrong ? Or, was this a bug in mod_jk 1.2.18, since corrected ? (But I find nothing that appears relevant in the Changes log at http://tomcat.apache.org/connectors-doc/miscellaneous/changelog.html) Thanks --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org