How to Install Apache mod_geoip module in Hestia


I want to install Apache mod_geoip module on Ubuntu 20.04;

to get GEOIP_COUNTRY_CODE environmental variable.

by this PHP code.


on the system I have installed only Apache and Nginx.

previously I had try, But not success, getting same countries. even added:
GeoIPScanProxyHeaders On

Vesta Installation cm:
sudo apt install -y libapache2-mod-geoip

Modify the file /etc/apache2/mods-enabled/geoip.conf
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: apache2ctl restart

If some one have tested this module please suggest me some trick to get work it properly
since I can’t change PHP code.

Depends if you’ve installed php-fpm, if you’ve not disabled it on installation, you have. So probaly something like this would work:

By default, hestia sticks on php fpm, mod_php is outdated.

Yes I have Disabled php-fpm