Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 65016 invoked from network); 2 Jul 2010 08:09:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jul 2010 08:09:33 -0000 Received: (qmail 33620 invoked by uid 500); 2 Jul 2010 08:09:30 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 33086 invoked by uid 500); 2 Jul 2010 08:09:25 -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 33065 invoked by uid 99); 2 Jul 2010 08:09:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 08:09:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Fri, 02 Jul 2010 08:09:15 +0000 Received: from [192.168.245.235] (p549EA9B4.dip0.t-ipconnect.de [84.158.169.180]) by tor.combios.es (Postfix) with ESMTPA id 4C7B92262A3 for ; Fri, 2 Jul 2010 10:07:12 +0200 (CEST) Message-ID: <4C2D9E8F.7070302@ice-sa.com> Date: Fri, 02 Jul 2010 10:08:47 +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: Re: [OT] Using httpd's mod_rewrite with mod_jk References: <4C2B783D.8090606@christopherschultz.net> <4C2C57B5.1060509@kippdata.de> <4C2D34AE.3070405@christopherschultz.net> In-Reply-To: <4C2D34AE.3070405@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Rainer, > > On 7/1/2010 4:54 AM, Rainer Jung wrote: >> Usually mod_rewrite is perfectly compatible with mod_jk. I must confess, >> that I'm not 100% sure about the case, where you try to rewrite a >> request that originally would have been handled by mod_jk to something >> that should not be handled by it. > > It appears that my setup (rewriting a request that normally would go to > jk to one that shouldn't go to jk) still ends up being handled by jk. Christopher, I personally find it hard to "visualise" when exactly in the Apache request handling cycle the JkMount directive intervenes. Like, /before RewriteRule/ or /after RewriteRule/. I am sure that it is at a very specific place in the cycle and with a very specific precedence, but neither the Apache httpd nor the mod_jk documentation explicitly indicate this (*). (Unlike, for example, in this page, where the precedence is clear : http://httpd.apache.org/docs/2.2/sections.html#mergin) And if even Rainer isn't sure.. That is why, with Apache/mod_jk, I tend to prefer working with the alternative to JkMount explained here (at the very end of the page) : http://tomcat.apache.org/connectors-doc/reference/apache.html (section: Using SetHandler and Environment Variables) To me, this makes it clearer, because the "proxying to Tomcat" is now embedded in a section, which has a clear precedence in the Apache configuration logic. Using that syntax, the directives > JkMount /context/some-specific-path/foo workerX > JkMount /context/some-other-path/bar workerX > JkMount /context/*.do workerX > JkMount /context/*.jsp workerX would be expressed as # covers the 1st one above setHandler jakarta-servlet SetEnv JK_WORKER_NAME workerX # but, as an example, exclude some URLs from the proxying SetEnvIf REQUEST_URI "\.(css|gif|jpe?g|js)$" no-jk ... ... # covers #3 and #4 above setHandler jakarta-servlet SetEnv JK_WORKER_NAME workerX ... Now, the problem becomes : are these Location and LocationMatch sections evaluated before, or after the Rewrite rules ? But for that, the Apache documentation is explicit. Rewrite happens *before* the URL is compared to the sections. (*) probably, because it is difficult to explain precisely in less than 2 pages of html full of Apache internals which most users would not understand anyway, so Rainer is discouraged from even attempting to... ;-) --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org