httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Bouza <>
Subject [users@httpd] Problems load balancing with and RewriteMap
Date Thu, 19 Apr 2007 22:08:14 GMT

I hope everyone can give me some help here. I've battling for a while 
without any luck.

I have the following in httpd.conf (changed domain to 'mydomain').


       DocumentRoot /var/www/

       LogLevel debug
       ErrorLog /var/log/httpd/
       CustomLog /var/log/httpd/ combined

       RewriteEngine On
       RewriteLog /tmp/rewrite.log
       RewriteLogLevel 10

       RewriteMap servers prg:/etc/httpd/conf/loadbalancing/
       RewriteRule ^/(.*)$ ${servers:$1} [P,L]
       #RewriteRule    ^/(.*)$$1        
[P,L]  ----> This line here works as a charm


Which will rewrite fine for the commented out 'anotherdomain' test (so 
the rule
is being hit for the virtual host). So everything is working fine EXCEPT
the script.

Here is the

#!/usr/bin/perl -w

$| = 1;
while (<STDIN>) {
       print "$_\n";

Pretty basic with no science at all. When ran from the command line it 
returs the URL without any problem. It has the right permissions. BUT 
for some reason the lb rewrite rule always proxys to / even though the 
script will return valid, browsable URLs when run from the command line.

Here is the rewrite log:

(1) go-ahead with proxy request proxy: [OK]
(2) init rewrite engine with requested uri /
(3) applying pattern '^/(.*)$' to uri '/'
(5) map lookup OK: map=servers key= -> val=
(2) rewrite / ->
(2) forcing proxy-throughput with

Now I tested this same config on Fedora using Apache 2.0.59 and it works 
perfect. Now the problem here is on RedHat with Apache 2.0.52.

Do I need to be aware of any extra modules?

Any help would be much appreciated.

Roberto Bouza.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message