Geolocation - GeoIP2 Apache broken


#1

Hello,
I have installed MaxMind DB Apache Module.
Now I am in setting of Matomo and in section Geolocation is:
GeoIP2 (Apache)
Broken

Error: The MM_COUNTRY_CODE $_SERVER variable is not set. Your server may not be configured correctly.

Matomo cannot find any GeoIP $_SERVER variables.

in my /etc/apache2/apache2.conf

###GeoIP - MaxMind
MaxMindDBEnable On
MaxMindDBFile COUNTRY_DB /usr/local/share/GeoIP/GeoLite2-Country.mmdb
MaxMindDBFile CITY_DB /usr/local/share/GeoIP/GeoLite2-City.mmdb

MaxMindDBEnv MM_COUNTRY_CODE CITY_DB/country/iso_code
MaxMindDBEnv MM_COUNTRY_NAME CITY_DB/country/names/en
MaxMindDBEnv MM_CITY_NAME CITY_DB/city/names/en
MaxMindDBEnv MM_LONGITUDE CITY_DB/location/longitude
MaxMindDBEnv MM_LATITUDE CITY_DB/location/latitude

Thank You for any help


(Daniel Städeli) #2

Hi, I have exactly the same problem and I’m stuck for 2 days trying to get rid of this error. What did you do to fix this?


(Thomas W) #3

Hello, I have the same error message “Error: The MM_COUNTRY_CODE $ _SERVER variable is not set. Your server may not be configured correctly.”
Have everything as described by maxmind, created.
The Apache Module maxminddb is enabled.
MaxMindDBEnable, MaxMindDBFile and MaxMindDBEnv set on apache2.conf

Matomo-Version: 3.7.0

I do not know
How can I fix it?


(Lukas Winkler) #4

Hi,

I know little about Apache, but if $ _SERVER["MM_COUNTRY_CODE"] is undefined then either the Apache extension is not set up correctly or the variable is called something different than MM_COUNTRY_CODE. (You can set this up in the Matomo General Settings)