Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 81666 invoked from network); 10 Dec 2004 23:48:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Dec 2004 23:48:44 -0000 Received: (qmail 97274 invoked by uid 500); 10 Dec 2004 23:48:28 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 97254 invoked by uid 500); 10 Dec 2004 23:48:28 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 97235 invoked by uid 99); 10 Dec 2004 23:48:28 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=NORMAL_HTTP_TO_IP,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.conduit-it.com (HELO strongbad.conduit-it.com) (216.74.182.133) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 10 Dec 2004 15:48:26 -0800 Received: (qmail 31814 invoked by uid 107); 10 Dec 2004 23:48:23 -0000 Received: from vpn.conduit-it.com (HELO ?10.0.1.51?) (aboyce@conduit-it.com@216.169.176.210) by mail.conduit-it.com with AES256-SHA encrypted SMTP; 10 Dec 2004 23:48:23 -0000 From: Andrew Boyce-Lewis To: users@httpd.apache.org In-Reply-To: <41BA29BD.90800@usaherbals.com> References: <1102698859.7880.116.camel@bacon.conduit-it.com> <41B9DD24.7030805@usaherbals.com> <1102715230.7880.143.camel@bacon.conduit-it.com> <41BA2516.1060002@usaherbals.com> <41BA2866.5010207@usaherbals.com> <41BA29BD.90800@usaherbals.com> Content-Type: text/plain Message-Id: <1102722554.7880.154.camel@bacon.conduit-it.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 10 Dec 2004 18:49:14 -0500 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked Subject: Re: [users@httpd] Apache config directives based on requestor ip address? X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mmm yes, localhost, that would actually work pretty well. The apache config would suffer in terms of complexity, but it would leave pretty much everything else unaffected. Our application constructs all hyperlinks using a defined url as the base, but this should allow that setting to be left alone. I will do some testing. Thanks for the idea! -Andrew On Fri, 2004-12-10 at 17:57, Sean T Allen wrote: > Sean T Allen wrote: > > > Or more on that idea... > > > > you could... > > > > run a front end server that just redirects requests via the rewrite > > conditions and two separate > > server that it gets proxied to... > > > > in psudeo we have: > > > > FRONT- > > > > RewriteCond %{REMOTE_HOST} 192.1.1.1 > > RewriteRule (.*) http://127.0.0.1:9000/$1 > > RewriteCond %{REMOTE_HOST} !192.1.1.1 > > RewriteRule (.*) http://127.0.0.1:9001/$1 > > > > each of those RewriteRule should be followed by a [P] > sorry about that... > > > 9000- > > > > DocumentRoot /a > > > > 9001- > > > > DocumentRoot /b > > > > > >> mod_rewrite is what you want... > >> > >> you can accomplish what you want... > >> > >> For example > >> > >> RewriteCond %{REMOTE_HOST} 192.1.1.1 > >> RewriteRule (.*) /alt-root/$1 > >> RewriteCond %{REMOTE_HOST} !192.1.1.1 > >> RewriteRule /alt-root/(.*) /reg-root/$1 > >> > >> And both can exist under the regualr document root > >> > >> so any access to alt-root from somewhere other than 192.1.1.1 > >> gets sent to reg-root ( security ) > >> and any 192.1.1.1 looks in alt-root instead... > >> > >> you get the basic idea... it needs a bit of tweaking... > >> > >> OR... > >> > >> you can filter yourself with c code using the apache api > >> or you can install a perl handler via mod-perl > >> > >> but really the mod_rewrite is the easiest way to go. > >> > >> > >> Andrew Boyce-Lewis wrote: > >> > >>>> From what I have read, mod_rewrite will allow me to change the URL > >>>> based > >>> > >>> > >>> on %{REMOTE_HOST}, however what I want to do is change is the > >>> DocumentRoot based on the remote host > >>> > >>> ...so that the URL would still be http://example.com, but the root that > >>> was being displayed would be different if I was coming from a specific > >>> host. Is this possible? > >>> > >>> -Andrew > >>> > >>> > >>> > >>> On Fri, 2004-12-10 at 12:30, Sean T Allen wrote: > >>> > >>> > >>>> mod_rewrite can be used to accomplish what you want in spirit if > >>>> not in the design you > >>>> have below. > >>>> > >>>> > >>>> Andrew Boyce-Lewis wrote: > >>>> > >>>> > >>>> > >>>>> I am looking for a way to apply alternative configuration > >>>>> directives to > >>>>> apache based on the source ip address. Basically, I was to do > >>>>> something > >>>>> like this: > >>>>> > >>>>> > >>>>> ServerName test.example.com > >>>>> > >>>>> DocumentRoot /var/web/root/a > >>>>> > >>>>> > >>>>> DocumentRoot /var/web/root/b > >>>>> > >>>>> > >>>>> > >>>>> Obviously the RequesterMatch directive does not exist. Has anyone > >>>>> solved > >>>>> this problem in the past? I can think of a number of somewhat ugly > >>>>> ways > >>>>> to solve this problem using iptables, but an elegant solution > >>>>> would be > >>>>> best. > >>>>> Any ideas and/or experience with such problems? > >>>>> > >>>>> Thanks, > >>>>> -Andrew > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> ______________________________________________________________________ > >>>> --------------------------------------------------------------------- > >>>> The official User-To-User support forum of the Apache HTTP Server > >>>> Project. > >>>> See for more info. > >>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > >>>> " from the digest: users-digest-unsubscribe@httpd.apache.org > >>>> For additional commands, e-mail: users-help@httpd.apache.org > >>>> > >>> > >>> > >> > >> --------------------------------------------------------------------- > >> The official User-To-User support forum of the Apache HTTP Server > >> Project. > >> See for more info. > >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > >> " from the digest: users-digest-unsubscribe@httpd.apache.org > >> For additional commands, e-mail: users-help@httpd.apache.org > >> > > > >--------------------------------------------------------------------- > >The official User-To-User support forum of the Apache HTTP Server Project. > >See for more info. > >To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > > " from the digest: users-digest-unsubscribe@httpd.apache.org > >For additional commands, e-mail: users-help@httpd.apache.org > > > > > ______________________________________________________________________ > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project. > See for more info. > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > " from the digest: users-digest-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org -- Andrew E. Boyce-Lewis Conduit Internet Technologies, Inc. 800.493.5045 x 210 814.867.8248 Fax http://www.conduit-it.com aboyce@conduit-it.com --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org