0

I upgraded lighttpd to stretch and I installed for my curiosity lighttpd_mod_GeoIP, I configured the module ...

server.modules = ( "
    ...
    mod_geoip,
    ...
")
geoip.db-filename = "/usr/share/GeoIP/GeoIP.dat"
geoip.memory-cache = "enable"

and I realized that not all _SERVER Variables are working. The following do not output anything.

<?php 
echo $_SERVER['GEOIP_ADDR'];
echo $_SERVER['GEOIP_CONTINENT_CODE'];
echo $_SERVER['GEOIP_COUNTRY_CODE'];
echo $_SERVER['GEOIP_COUNTRY_NAME'];
echo $_SERVER['GEOIP_REGION'];
echo $_SERVER['GEOIP_REGION_NAME'];
echo $_SERVER['GEOIP_CITY'];
echo $_SERVER['GEOIP_DMA_CODE'];
echo $_SERVER['GEOIP_AREA_CODE'];
echo $_SERVER['GEOIP_LATITUDE'];
echo $_SERVER['GEOIP_LONGITUDE'];
echo $_SERVER['GEOIP_POSTAL_CODE'];
?>

I also upgraded the geoIP2 database via apt
but I suppose there are some more settings I must do.

In fact I need the $_SERVER['GEOIP_LATITUDE'] and $_SERVER['GEOIP_LONGITUDE'] but they are blank. Can someone give a hint?

  • it looks like the GeoIP Package is commercial, and the free stuff do not cover the vars. – Henry Stack Jun 27 '18 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.