The Core

Why We Are Here => Web Development => Topic started by: ukgimp on September 19, 2013, 02:32:32 PM

Title: Blocking Various Countries By IP
Post by: ukgimp on September 19, 2013, 02:32:32 PM
Or only include certain ones.

Eg block all of Africa

Easiest way of doing it on LAMP?

Title: Re: Blocking Various Countries By IP
Post by: JasonD on September 19, 2013, 02:51:04 PM
http://www.ip2location.com/free/visitor-blocker

IPTables is more efficient that .htaccess but both will work
Title: Re: Blocking Various Countries By IP
Post by: ukgimp on September 19, 2013, 02:57:34 PM
Saw that one.

Better to exclude countries I suspect rather than allow, due to the fact that you might have incomplete data.

thanks
Title: Re: Blocking Various Countries By IP
Post by: JasonD on September 19, 2013, 03:01:01 PM
Agreed, only ever deny, not allow - presuming the list will be shorter that is.
Title: Re: Blocking Various Countries By IP
Post by: JasonD on September 19, 2013, 03:03:31 PM
it's easy enough to do on the command line but here is a script to help you on your way

https://github.com/tlhackque/BlockCountries