httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk.vanGulik" <Dirk.vanGu...@jrc.it>
Subject Re: strong disapproval from the mirrors on running CGI programs
Date Sat, 14 Jun 1997 10:52:07 GMT

> > b) make the "download" link go to /dist locally; a HEADER in that
> > directory will have something like
> 
> 	The 'download' link should go to
> http://cgi.apache.org/mirrors.cgi. I think that dist/ pointing to the
> hyperreal download site will not significantly help the bandwidth
> situation.
> 
We use a little forwarder at the site, which simply forwards to
a 'randomish' site seeded by the IP address and the time. Gives
little load.

Dw.

#!/usr/local/bin/perl
#
use siteconfig_local;
use ForwardAPI;
use TrapperAPI;

open(FH,$config::local_conf.'/third.party.tsv')
	or &Trap::Error(500,"Could not open database: $!");
@db=(<FH>);
close(FH);

# Clean out obsolete/double entries due to conversion
# from the Access database;
#
map{ $db{ lc($1) } =1 if m/^([\w\.\-]+)\s+/; } @db;
@sites=keys(%db);

&Trap::Error(500,"No third party sites in the database ?")
	unless $#sites>=0;

srand( ($ENV{REMOTE_ADDR} =~ s/\D+//g) );
$i=(int(rand($#sites+1)) + time/600) % ($#sites+1);

$url='ftp://'.$site[ $i].'/pub/credit/index.html'

&Forward::To( $HTTP_STemp, $url);

exit 0;


Mime
View raw message