You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Kent, Mr. John" <ke...@nrlmry.navy.mil> on 2000/09/06 01:36:07 UTC
Unnatural Uses
Greetings,
Using Squid as an accelerator with an Apache Light and an Apache Heavy
(mod-perl) server.
Now trying to at load balancing via the redirect.pl script
for http://mako.nrlmry.navy.mil/tc-bin/tc_home
Doesn't work.
While the redirect does change the URL, whenever it changes it to
sgi-demo.nrlmry.navy.mil:8888
I get a Squid generated error page which says
"The requested URL Could not be retrieved
While trying to retrieve the URL:
http://sgi-demo.nrlmry.navy.mil:8888/tc-bin/tc_display
The following error was encountered:
* Connection Failed
The system returned:
(126) Cannot assign requested address
The remote host or network may be down. Please try the request again"
Funny thing is that the server is UP and that when I click on the hyperlink
Squid says it can't connect to it comes up fine.
Does anyone have any suggestions? (Good, Bad or Ugly)
Here is my redirect.pl script:
#!/users/webuser/perl/bin/perl
$| = 1;
# Testing switching between two servers
my(@HEAVY) = qw{sgi-demo.nrlmry.navy.mil 127.0.0.1};
my($i,$j) = 0;
while(<>){
if ($_ =~ /sat-bin|tc-bin/){
my($value) = $HEAVY[rand(@HEAVY)];
# Rotate servers
s%127\.0\.0\.1(:\d+)?%$value%;
# Specify heavy mod_perl server for cgi scripts
s%(:\d+)?/sat-bin%:8888/sat-bin%i && next;
s%(\:\d+)?/tc-bin%:8888/tc-bin%i && next;
}
} continue {
print LOG "$$ > $_\n";
print; # falls through to
apache_light
}
John Kent
(831) 656-4890
Monterey, CA