Install GeoIP Apache Module in CentOS

To install GeoIP Apache module on CentOS 7, run

yum -y install GeoIP GeoIP-devel GeoIP-data
yum -y install mod_geoip 

Now you need to configure Apache VirtualHost.

To block traffic, add following to your VirtualHost entry

RewriteEngine On
RewriteRule ^(.*)$ [L]

In this example, traffic from CN, RU and A1 (stands for proxy IP) get redirected to specified URL.


Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *