Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD523D6E6 for ; Tue, 11 Dec 2012 15:06:11 +0000 (UTC) Received: (qmail 62954 invoked by uid 500); 11 Dec 2012 15:06:08 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 62836 invoked by uid 500); 11 Dec 2012 15:06:08 -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 62805 invoked by uid 99); 11 Dec 2012 15:06:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2012 15:06:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=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, 11 Dec 2012 15:05:58 +0000 Received: from [192.168.245.129] (p549E8F28.dip0.t-ipconnect.de [84.158.143.40]) (Authenticated sender: andre.warnier@ice-sa.com) by tor.combios.es (Postfix) with ESMTPA id A71B13C0677 for ; Tue, 11 Dec 2012 16:06:30 +0100 (CET) Message-ID: <50C74BBE.7000309@ice-sa.com> Date: Tue, 11 Dec 2012 16:05:34 +0100 From: =?windows-1252?Q?Andr=E9_Warnier?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Running Tomcat Behind Apache HTTP Server References: <50C66579.1060402@ice-sa.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Dhruva Reddy wrote: > Thanks, Andr�, for your response. > > To give you a little more context, I needed to get this working as soon as > possible, which I basically have. Eventually, yes, I want the static > content to be served by HTTPD, and the dynamic content to be served by > Tomcat. I did not want to deploy my application as ROOT, for reasons that, > now that I think about it, don't really make sense. > > Anyway, your clue about the Directory directive was very helpful. It > turned out that my rewrite rules were being ignored. I ended up with two > rules, each on the condition that the request URI does not already contain > the context. I settled on the following (I'm running a Grails application > which automagically recognizes the "html" extension): > > RewriteEngine On > RewriteCond $0 !^/application/(.*) > RewriteRule ^(.*)/$ ajp://localhost:8009/application/$1 [P] > RewriteCond $0 !^/application/(.*) > RewriteRule ^(.*)\.html$ ajp://localhost:8009/application$1.html [P] > > I know I still have some work to do, but at least I now have it basically > working. > Good if it works. You did not originally specify which Apache-Tomcat connector you were using, so I took a potshot and guessed mod_jk, wrongly. About the rules above : - what happens when the URL already starts with "/application" ? - the capture part in the RewriteCond above does not seem to be necessary, as you are testing for a "not match", so whatever is captured wouldn't be useful anyway. - what happens when the Tomcat webapp returns a redirect ? Do you have some ProxyPassReverse directive for that ? If I may comment, I believe that by forwarding "/" to tomcat's "/application", and afterward having other sub-sections of "/" not being forwarded to Tomcat, you are setting yourself up for a lot of complications later on. A lot of directive's effects in Apache are "inherited" from a top location to sub-locations by default, and you are going to find yourself obliged to countermand this inheritance in each sub-section. When you start mixing this with the relative paths that tomcat will generate for embedded images etc, and with (maybe) authentication and access-control, you'll be in for a treat. If you are just starting this website's setup, it may be better to pause and think of a simpler layout. Just my two cent. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org