GeoIP directive in apache2

Discussion in 'HOWTO-Related Questions' started by jva1601, Mar 15, 2008.

  1. jva1601

    jva1601 New Member

    To add this to my apache2.conf what directive shall I enclose it in using the configuration below? Thank you!

    GeoIPEnable On
    GeoIPDBFile /path/to/GeoIP.dat

    SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
    SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry
    # ... place more countries here

    Deny from env=BlockCountry

    # Optional - use if you want to allow a specific IP address from the country you denied
    # (See http://httpd.apache.org/docs/1.3/mod/mod_access.html for more details)
    Allow from 10.1.2.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    This goes into your global Apache configuration or in a vhost configuration if you need it for a special vhost only.

    Put this in a vhost configuration.
     

Share This Page