savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers-public] Re: autoredirect setup help


From: Randy Kobes
Subject: [Savannah-hackers-public] Re: autoredirect setup help
Date: Tue, 18 Nov 2008 10:20:27 -0600
User-agent: Thunderbird 1.5.0.14ubu (X11/20080306)

Karl Berry wrote:
Hi again,

Please reply to address@hidden, which will reach
Sylvain and me and everyone else concerned with savannah.

Thanks,
Karl

Date: Wed, 12 Nov 2008 19:49:11 +0100
From: Sylvain Beucler <address@hidden>
To: Karl Berry <address@hidden>
Cc: address@hidden
Subject: Re: [Savannah-hackers-public] autoredirect for savannah downloads

[...]

It will be much easier for me to understand what to do if I can see
the final configuration, which is probably the Apache configuration
directives.


For the Maxmind database, I current use the following set of
instructions (which I use when installing AWstats with the geoip
module):

  aptitude install libgeo-ipfree-perl libgeoip1
mkdir -p -m 755 /usr/local/share/GeoIP/
  cat <<'EOF' > /etc/cron.d/maxmind
  # Update Country/City IP-lookup databases from MaxMind
  # TODO: use -o /dev/null, then use $? to check if the download was successful
  0 3 10 * *      root    wget 
http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz -O- | zcat > 
/usr/local/share/GeoIP/GeoIP.dat
  10 3 10 * *     root    wget 
http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -O- | zcat > 
/usr/local/share/GeoIP/GeoLiteCity.dat
  EOF
# TODO: do this non-interactively
  aptitude install build-essential
  perl -MCPAN -e shell
  # > install Geo::IP


[...]


Hi all,
For the Apache side of things, there's two set of directives I use, as I'm running a "vanilla" server on port 80 and a mod_perl-enabled server on port 8043. For the vanilla server, I have

<VirtualHost theoryx5.uwinnipeg.ca>
        ServerAdmin address@hidden
        ServerName mirror.ctan.org
        ProxyPass / http://theoryx5.uwinnipeg.ca:8043/ctan/
        ProxyPassReverse / http://theoryx5.uwinnipeg.ca:8043/ctan/
</VirtualHost>

while the mod_perl one has

<Location /ctan>
   SetHandler perl-script
   PerlSetVar GeoIPDBFile "/usr/local/share/GeoIP/GeoIP.dat"
   PerlSetVar GeoIPMirror "/usr/local/share/GeoIP/ctan.txt"
   PerlSetVar GeoIPFlag Standard
   PerlSetVar GeoIPDefault us
   PerlResponseHandler Apache2::Geo::Mirror->auto_redirect
</Location>

I've attached a cron shell script that I use to update the database, which invokes the attached perl script - one would need to change the location to move the database file at the end of this script to reflect where you want it placed.

Let me know if you have any questions about this.

--
best regards,
Randy

Attachment: ctan.sh
Description: application/shellscript

Attachment: ctan.pl
Description: Perl program


reply via email to

[Prev in Thread] Current Thread [Next in Thread]