perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Gormley <cl...@traveljury.com>
Subject Re: Dynamic Proxy Setup, resend, no styles
Date Mon, 14 Aug 2006 15:58:30 GMT
On Mon, 2006-08-14 at 11:44 -0400, Tom Weber wrote:
> Hi,
> 
> I would like to set up dynamic proxy server names in httpd.conf in an 
> Apache/2.2.2 (Unix) mod_apreq2-20051231/2.5.7 mod_perl/2.0.2 
> Perl/v5.8.8 on Red Hat  2.6.9-34.0.2.ELsmp #1 SMP environment.

Hi Tom

having just spent all day looking at dynamic configuration, I know
exactly where to look.

http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html
and
http://perl.apache.org/docs/2.0/api/Apache2/ServerUtil.html#C_add_config_

You could do this as follows: (untested)

<Perl>
   my $hostname = `hostname`;
   my %map = (
      F1 => 'M1',
      F2 => 'M2'
   );
   push @ProxyPass,"/users/","http://$map{$hostname}/users";
</Perl>

or, in a startup file:
$s = Apache2::ServerUtil->server;
$server->add_config("ProxyPass /users/ http://$map{$hostname}/users");
> 

clint

________________________________________________________________________

Clinton Gormley clinton@traveljury.com

www.TravelJury.com - For travellers, By travellers




Mime
View raw message