Maxmind make several different Geolocation products the Free / Open Source versions include GeoLite Country & GeoLite City (http://www.maxmind.com/app/geolitecity)
Looks like for Apache you also need Mod_GeoIP & the GeoIP C Library. (http://www.maxmind.com/app/mod_geoip)
There is also a straight PHP mod (http://www.maxmind.com/app/php)
The setup is a bit beyond the scope of this forum, but there are plenty of sites out there that will list all the steps (this one is from [
www.sequentiallogic.com]) but basically if you are happy with the lighter pure php version just download the php files geoipcity.inc, geoip.inc, and geoipregionvars.php then download a copy of the binary format file put all these files in a web accessible directory and then make a php file containing this
<?php
require_once('/PATH/TO/GeoIP/geoipcity.inc');
$gi = geoip_open('/PATH/TO/GeoIP/GeoLiteCity.dat', GEOIP_STANDARD);
$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
echo '<pre>';
print_r($location);
echo '</pre>';
?>
I believe you are in <?php echo $location->city ?>, <?php echo $location->region ?>