apache2ctl -t -D DUMP_MODULES
geoip_module
(shared) libapache2-mod-geoip is already the newest version (1.2.10-1).
<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
</IfModule>
ls -rw-r--r-- 1 root root 2099217 Nov 19 2020 /usr/share/GeoIP/GeoIP.dat
no errors in apache site log site.error.log
test geoip file:
<html>
<head>
<title>What is my IP address - determine or retrieve my IP address</title>
</head>
<body>
<?php
if (getenv('HTTP_X_FORWARDED_FOR')) {
$pipaddress = getenv('HTTP_X_FORWARDED_FOR');
$ipaddress = getenv('REMOTE_ADDR');
echo "Your Proxy IP address is : ".$pipaddress. " (via $ipaddress) " ;
} else {
$ipaddress = getenv(REMOTE_ADDR);
echo "Your IP address is : $ipaddress";
}
$country = getenv('GEOIP_COUNTRY_NAME');
$country_code = getenv('GEOIP_COUNTRY_CODE');
echo "<br/>Your country : $country ( $country_code ) ";
?>
</body>
</html>
show Your country : ( )