I had this working once.
I'm using a dynamic rewrite map to do some load balancing. Using a little perl script to call a running process manager that brings stuff up and down. Proc mgr has a simple REST interface.
apache.conf fragment
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteMap VOLLEY_BALL_SERVERS prg:/Users/todd/bin/volley
RewriteRule ^/seaside/.*$ ${VOLLEY_BALL_SERVERS:$1} [P,L]
</IfModule>
volley is a perl script - dead simple and it works fine from the command line.
#!/usr/bin/perl
$| = 1;
while (<STDIN>) {
my $cmd = $_;
open(MAP, "| curl [link|http://localhost:9550/rewriteMap?url=$cmd|http://localhost:955...writeMap?url=$cmd]");
while(<MAP>) {
print $_;
}
}
When I run volley from the cmd line, I can type urls and they get mapped like I expect.
%volley
cv
[link|http://foo/seaside/cv|http://foo/seaside/cv]
bar
[link|http://foo/seaside/bar|http://foo/seaside/bar]
When I let apache run it, it gets called, but $cmd is always empty. I can't see why that would be. Even weirder, sometimes volley gets/translates several lines of empty input for one request. Sometimes.
I'm stumped