Loading ...
Sorry, an error occurred while loading the content.

56003[MP2] Apache::GeoIP little bug?

Expand Messages
  • Enrico Sorcinelli
    Dec 3, 2003
      Hi all,

      I've found a little bug in Apache::GeoIP module (1.215) when using it under
      mod_perl 2 (Apache 2.0.47, Perl 5.8.1, mod_perl 1.99_10):

      [Wed Dec 03 13:38:41 2003] [error] [client] Can't locate object method "remote_ip" via package "Apache::Connection" at /home/perl-5.8.1/lib/site_perl/5.8.1/i686-linux-thread-multi/Apache2/Apache/Geo/IP.pm line 73.

      In httpd.conf:

      PerlModule Apache2
      <Perl >
      package My::Apache::GeoIP;
      use Apache::Geo::IP;
      use strict;
      use Apache::Const -compile => 'OK';
      sub handler {
      my $r = Apache::Geo::IP->new(shift);
      my $country = uc($r->country_code_by_addr());
      return OK;
      <Location /geoip>
      SetHandler perl-script
      PerlResponseHandler My::Apache::GeoIP
      PerlSetVar GeoIPDBFile "/usr/local/share/GeoIP/GeoIP.dat"
      PerlSetVar GeoIPFlag Standard

      I think that this happnes because Apache2/Apache/Geo/IP.pm don't loads
      Apache::Connection class.
      With simple patch (that I've attached) it seems to work fine.


      - Enrico
    • Show all 2 messages in this topic