2016-12-24 48 views
0

這裏是我的系統信息:maxminddb模塊:DB的MaxMind文件包含無效的元數據

$ apachectl -v 
Server version: Apache/2.4.18 (Ubuntu) 
Server built: 2016-07-14T12:32:26 

$ cat /etc/*release* | grep -i dist 
DISTRIB_ID=Ubuntu 
DISTRIB_RELEASE=16.04 
DISTRIB_CODENAME=xenial 
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS" 

$ uname -r 
4.4.0-57-generic 

我想安裝mod_maxminddb。我安裝geoipupdate作爲先決條件,並將其配置爲不僅包括GEOLITE上的數據庫,但任何商業酮(using this

$ ls -l /etc/GeoIP.conf 
-rw-r--r-- 1 root root 818 Dec 24 18:29 /etc/GeoIP.conf 
$ ls -l /usr/share/GeoIP/ 
total 0 
$ geoipupdate 
$ ls -l /usr/share/GeoIP/ 
total 187444 
-rw-r--r-- 1 root root 112192399 Dec 24 18:46 GeoIP2-City.mmdb 
-rw-r--r-- 1 root root 3012279 Dec 24 18:46 GeoIP2-Country.mmdb 
-rw-r--r-- 1 root root 47721533 Dec 24 18:46 GeoIPCity.dat 
-rw-r--r-- 1 root root 1699494 Dec 24 18:45 GeoIP.dat 
-rw-r--r-- 1 root root 4189407 Dec 24 18:45 GeoIPISP.dat 
-rw-r--r-- 1 root root 4299547 Dec 24 18:45 GeoLiteASNum.dat 
-rw-r--r-- 1 root root 17760694 Dec 24 18:45 GeoLiteCity.dat 
-rw-r--r-- 1 root root 1054583 Dec 24 18:45 GeoLiteCountry.dat 

然後在遵守,並且安裝了mod_maxminddb,並且當Apache是​​配置爲使用商業數據庫,該以下錯誤被拋出

$ apachectl -M 
AH00526: Syntax error on line 12 of /etc/apache2/mods-enabled/maxminddb.conf: 
MaxMindDBFile: Failed to open /usr/share/GeoIP/GeoIPCity.dat: The MaxMind DB file contains invalid metadata 

但就是不 Apache是​​配置爲使用GEOLITE上的數據庫的情況。

有什麼想法?

回答

0

您沒有包含您的Apache配置,但您似乎試圖使用mod_maxminddbGeoIPCity.dat(GeoIP Legacy)。它只適用於GeoIP2。調整maxminddb.conf的第12行以代替GeoIP2-City.mmdb

+0

'.mmdb'文件是geolite(無論版本)數據庫,而我希望使用我購買的商業版本。任何想法? – MrRoth

+0

假設您沒有重命名它,GeoIP2-City.mmdb是GeoIP2城市商業數據庫。 GeoLite數據庫被命名爲'GeoLite2-City.mmdb'。 'dat'文件不適用於這個模塊。 –

+0

猜想我在兩者之間感到困惑。如果'。mmdb'是商業的,那麼我很高興。 – MrRoth