我最近成功安装了MaxMind的MaxMindDB apache模块。
我添加了一个名为geoip.conf
的新文件到/etc/httpd/conf.d/
,内容如下:
<IfModule mod_maxminddb.c> MaxMindDBEnable On MaxMindDBFile COUNTRY_DB /some/dir/GeoLite2-Country.mmdb MaxMindDBEnv MM_COUNTRY COUNTRY_DB/country/iso_code SetEnvIf MM_COUNTRY US AllowUS Deny from all Allow from env=AllowUS </IfModule>
当运行apachectl -t
我得到以下错误:
Syntax error on line 11 of /etc/httpd/conf.d/geoip.conf: deny not allowed here
当我评论“拒绝所有”行时,我得到了一个类似的错误,说明allow not allowed here
我无法在网上find任何东西,因为这个模块几乎没有文档。 有谁知道如何解决这一问题?
这只是因为您的Deny
和Allow
需要在容器中应用,可以是<Directory>
, <Files>
或<Location>
部分。