public
Description: Look up country by IP address
Homepage: http://cpan.uwinnipeg.ca/~rkobes/Apache-GeoIP
Clone URL: git://github.com/rkobes/apache-geoip.git
rkobes (author)
Thu Apr 23 20:36:04 -0700 2009
commit  6504106eba1eb9daee1a35bde46d4fda6e4b5633
tree    aac61cc1712cd225bb45429e100d05c82e3d7f23
parent  78692b088ee6273d4c17d92b611f9c9c51bee2c7
name age message
directory Apache/ Sat Apr 18 22:11:51 -0700 2009 fix robot code [rkobes]
directory Apache2/ Sat Apr 18 19:17:49 -0700 2009 mod_perl-1 support [rkobes]
file Changes Thu Apr 23 20:36:04 -0700 2009 add pod tests [rkobes]
file INSTALL Mon Feb 16 12:37:11 -0800 2009 import of (modified) CPAN 1.63 sources [rkobes]
file MANIFEST Thu Apr 23 20:36:04 -0700 2009 add pod tests [rkobes]
file META.yml Sun Apr 12 21:26:05 -0700 2009 update META.yml [rkobes]
file Makefile.PL Sun Apr 12 20:46:19 -0700 2009 fix tests [rkobes]
file README Mon Feb 16 12:37:11 -0800 2009 import of (modified) CPAN 1.63 sources [rkobes]
directory t/ Thu Apr 23 20:36:04 -0700 2009 add pod tests [rkobes]
README
NAME
    Apache::Geo::IP - Look up country by IP Address

SYNOPSIS
    # in httpd.conf 
    # PerlModule Apache::HelloIP 
    #<Location /ip> 
    #   SetHandler perl-script 
    #   PerlHandler Apache::HelloIP 
    #   PerlSetVar GeoIPDBFile "/usr/local/share/geoip/GeoIP.dat" 
    #   PerlSetVar GeoIPFlag Standard 
    #</Location>

    # file Apache::HelloIP

    use Apache::Geo::IP; use strict;

    use Apache::Constants qw(OK);

    sub handler { 
       my $r = Apache::Geo::IP->new(shift);
       $r->content_type('text/plain'); 
       my $country = uc($r->country_code_by_addr());

       $r->print($country);
  
       return OK;
    }

DESCRIPTION
    This module constitutes a mod_perl (both versions 1 and 2) interface 
    to the Geo::IP and Geo::Mirror modules. Geo::IP is used to look up in 
    a database a country of origin of an IP address, while Geo::Mirror
    is used to select a mirror by country from a specified list. See
    the documentation for Apache::Geo::IP and Apache::Geo::Mirror
    for more details.

    The included tests require Apache::Test, which can be obtained
    in the mod_perl-2 sources or in the httpd-test distribution.
    These tests need a network connection to run; some may fail
    due to timeouts upon doing certain name lookups.

    The mod_perl-2 modules included here, with prefix Apache2::*,
    will only work with mod_perl-1.999022 and above (RC5 or greater
    of the CPAN distribution).

PPM PACKAGE
    A Win32 ppm package, suitable for use with ActivePerl
    compatible Perl packages, is available at
        http://theoryx5.uwinnipeg.ca/ppmpackages/
    for ActivePerl 6xx and at
        http://theoryx5.uwinnipeg.ca/ppms/
    for ActivePerl 8xx. To install, within the ppm shell set the 
    repository to
        http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer
    for ActivePerl 6xx and to
        http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
    for ActivePerl 8xx, and then
        ppm> install Apache-GeoIP

AUTHOR

    The look-up code for associating a country with an IP address 
    is based on the GeoIP library and the Geo::IP Perl module, and is 
    Copyright (c) 2002, T.J. Mather, tjmather@tjmather.com, New York, NY, 
    USA. See http://www.maxmind.com/ for details. The mod_perl interface 
    is Copyright (c) 2002, Randy Kobes <randy@theoryx5.uwinnipeg.ca>.

   All rights reserved.  This package is free software; you can redistribute 
   it and/or modify it under the same terms as Perl itself.