Isso ocorre simplesmente porque seus Deny e Allow precisam ser aplicados em um contêiner, seja na seção <Directory> , <Files> ou <Location> .
Eu recentemente instalei o módulo MaxMindDB apache da MaxMind com sucesso.
Eu adicionei um novo arquivo chamado geoip.conf to /etc/httpd/conf.d/ com o seguinte conteúdo:
<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>
Ao executar apachectl -t , recebo o seguinte erro:
Syntax error on line 11 of /etc/httpd/conf.d/geoip.conf:
deny not allowed here
Quando eu comentei a linha "Negar de todos", recebi um erro semelhante informando que allow not allowed here
Não consegui encontrar nada on-line, pois este módulo tem pouca documentação. Alguém sabe como consertar isso?
Tags geoip apache-2.2 httpd.conf