To install geoip on debian lenny:
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
sudo mkdir -v /usr/share/GeoIP
sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat
sudo apt-get install php5-geoip
and then try it in PHP:
print_r(geoip_record_by_name('php.net'));
returns:
Array
(
[country_code] => US
[country_code3] => USA
[country_name] => United States
[region] => CA
[city] => Sunnyvale
[postal_code] => 94089
[latitude] => 37.4249000549
[longitude] => -122.007400513
[dma_code] => 807
[area_code] => 408
)