The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: 1 [2]   Go Down

Author Topic: Seems mod_geoip2 was worth the effort  (Read 15556 times)

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 583
Re: Seems mod_geoip2 was worth the effort
« Reply #15 on: April 16, 2011, 03:32:59 PM »

I guess it got better! This is pretty close. Just the next town :)

Quote
Hello visitor from Buxtehude, Niedersachsen, Germany
IP Address: 91.97.163.111
Hostname: host-091-097-163-111.ewe-ip-backbone.de
Saturday, Apr 16, 2011 3:30 PM CEST
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Seems mod_geoip2 was worth the effort
« Reply #16 on: April 16, 2011, 11:43:40 PM »

Getting there I guess. Maxmind is a US company, their real concern is the US and not the rest of the world. I'm sure they have to have contacts at ISPs to know how the ip blocks are assigned by them, so I am sure countries that are considered hostile to the US there is going to be a pretty poor return from  the DB.

It's interesting to note they do state a % of accuracy on the DBs. You'll notice even on the free one, the accuracy inside the US is pretty high, where outside the US it get's poor.  I'm sure it an accumulative average across all countries so because of the challenge noted above, it takes a hit on the % point. It's going to be interesting to see how they deal with IPv6 in the future.

Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Seems mod_geoip2 was worth the effort
« Reply #17 on: March 10, 2012, 11:55:42 AM »

Hey Sob, I know you monitor this forum. Did you happen to see this?
http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/
Logged

Sob

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 72
Re: Seems mod_geoip2 was worth the effort
« Reply #18 on: March 19, 2012, 02:49:46 AM »

No, I didn't notice it. And unfortunately is doesn't seem that I will be able to find time to play with it in near future. But on very quick look it seems that this might be enough:
Code: [Select]
diff -Naur mod_geoip2_1.2.5-ipv6-2a/mod_geoip.c mod_geoip2_1.2.5-ipv6-3/mod_geoip.c
--- mod_geoip2_1.2.5-ipv6-2a/mod_geoip.c 2010-11-24 02:35:01.726736800 +0100
+++ mod_geoip2_1.2.5-ipv6-3/mod_geoip.c 2012-03-19 02:44:47.935774500 +0100
@@ -500,7 +500,15 @@
  break;
  case GEOIP_CITY_EDITION_REV0:
  case GEOIP_CITY_EDITION_REV1:
+ if(is_v6) break;
  gir = GeoIP_record_by_addr(cfg->gips[i], ipaddr);
+ goto geoip_city_id;
+ case GEOIP_CITY_EDITION_REV0_V6:
+ case GEOIP_CITY_EDITION_REV1_V6:
+ if(!is_v6) break;
+ gir = GeoIP_record_by_addr_v6(cfg->gips[i], ipaddr);
+
+ geoip_city_id:
  if (gir != NULL) {
          if ( gir->country_code != NULL ) {
    region_name = GeoIP_region_name_by_code(gir->country_code, gir->region);
It's completely untested, I just changed the file and didn't even try to compile it.
Logged

Sob

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 72
Re: Seems mod_geoip2 was worth the effort
« Reply #19 on: March 19, 2012, 03:06:34 AM »

On second look, there is also mod_geoip2 1.2.7 and it seems to support everything. ;D
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Seems mod_geoip2 was worth the effort
« Reply #20 on: March 19, 2012, 09:05:51 PM »

Yes, it seems to, tho I have not heard from anyone I have given it to with IPv6 yet. It requires the newer API 1.4.8 which I did get to build on Windows. I am waiting word on the IPv6 part and if it's working (even somewhat) will be putting it up here.

I have since done a r2 of it, due to how I dealt with the ssize_t in the API the first time is incorrect, even I have seen some odd returns with it, I redid it all and compiled again and so far I am not seeing someone I know to be in Australia showing as coming from AU, Iraq, Hungary and many others.
« Last Edit: March 20, 2012, 12:50:38 AM by Gregg »
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Seems mod_geoip2 was worth the effort
« Reply #21 on: March 06, 2013, 08:56:31 AM »

1.2.8 source has been released. Haven't had the time to study it in depth yet. One thing I did see, it will ignore local IPs finally. This is a good thing since the module will crash at times when it happens to look up a local IP.
Logged
Pages: 1 [2]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13