I want to install Apache mod_geoip module on Ubuntu 20.04;
to get GEOIP_COUNTRY_CODE environmental variable.
by this PHP code.
<?php echo $_SERVER['GEOIP_COUNTRY_CODE'];
on the system I have installed only Apache and Nginx.
previously I had try, But not success, getting same countries. even added:
Vesta Installation cm:
sudo apt install -y libapache2-mod-geoip
Modify the file
and remove the # in front of GeoIPDBFile - and set GeoIPENable to On:
GeoIPEnable On GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
Saved the file, and restart apache:
If some one have tested this module please suggest me some trick to get work it properly
since I can’t change PHP code.