Activating mod_geoip

Discussion in 'Installation/Configuration' started by fbarcenas, Apr 17, 2016.

  1. fbarcenas

    fbarcenas Member

    I installed libapache2-mod-geoip
    Added the following to my apache directives in the OPTIONs tab under websites:
    Code:
    #Block Certain Countries (with mod_geoip2)
    <IfModule mod_geoip.c>
        GeoIPEnable On
        GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
    
        SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
        SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry
            SetEnvIf GEOIP_COUNTRY_CODE BR BlockCountry
        # ... place more countries here
    
    </IfModule>
    They I tried adding this after this to /usr/local/ispconfig/server/conf/vhost.conf.master:
    Code:
    <Directory />
        Deny from env=BlockCountry
    </Directory>
    But there are many places it could exist. When I put it in, it give a FORBIDDEN error to everyone.

    Where is the right place to insert it??
     
  2. Have you enabled it using a2enmod?
     
  3. fbarcenas

    fbarcenas Member

    yes.
     
  4. /etc/apache2/mods-enabled/geoip.conf

    Does this exist?

    <IfModule mod_geoip.c>
    GeoIPEnable On
    GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
    GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache
    GeoIPDBFile /usr/share/GeoIP/GeoIP.dat CheckCache
    GeoIPScanProxyHeaders On
    </IfModule>

    I'm also assuming youve restarted apache2
     
  5. fbarcenas

    fbarcenas Member

    Yes
    not exactly in that form , but yes.
    yes, that is how I got locked out of the website.
     
  6. I'm afraid I am not sure then. Sorry.
     
  7. Just a thought, is anything posted to the apache error log for that website? Or is it just a case of it saying the plugin is unknown.
     

Share This Page