Dear Sirs,
I found some problems using the geoip module. My system is a debian squeeze x86_64; and I installed the following packages:
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Nome Versione Descrizione +++-=============================================-=============================================-========================================================================================================== ii geoip-bin 1.4.7~beta6+dfsg-1 IP lookup command line tools that use the GeoIP library ii geoip-database 1.4.7~beta6+dfsg-1 IP lookup command line tools that use the GeoIP library (country database) ii libgeoip-dev 1.4.7~beta6+dfsg-1 Development files for the GeoIP library ii libgeoip1 1.4.7~beta6+dfsg-1 A non-DNS IP-to-country resolver library
Using /usr/share/GeoIP/GeoIP.dat as database, the geoip_match("$si", "src") function failed with retcode -2 (NULL from GeoIP_record_by_name()). And finally I found the problem with the GeoIP file DB itself. In particular, compiling a mini program for debug, it said:
Invalid database type GeoIP Country Edition, expected GeoIP City Edition, Rev 1
After manually downloading the GeoLiteCity.dat from MaxMind.com everything went fine.
I wrote for letting others know my solution, and for asking you if there is a cleaner way to solve it.
Best regards, Francesco Castellano
Francesco wrote:
Hello Francesco,
so this means the database that is installed as debian dependency is not correct? It seems that in sid there is another package available http://packages.debian.org/de/sid/geoip-database-contrib - is this the correct one?
As this seems to be not available for squeeze, what about just documenting this in the module README? Can you give me a bit more details, maybe the download URL - then i can add it to the docs.
Regards,
Henning
Hello Henning,
I downloaded the DB from the following url:
~# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
The official site I think it is http://www.maxmind.com/app/geolitecity
Regarding the package geoip-database-contrib from sid, actually I don't know because I have no sid available at the moment, but my guess is yes, I think they are the correct DBs. Anyway, as soon as I will be able to check it, I'll answer your question.
Best regards, Francesco Castellano
On Thu, May 12, 2011 at 11:08 AM, Henning Westerholt Henning.Westerholt@1und1.de wrote: