Next Previous Contents

2. Introduction

The purpose of this package of programs is to assist the webmaster in blocking out entire countries from having access to his/her web site.

This package is intended for web sites running on "shared" servers. It can also be used with web sites running on dedicated servers or virtual private servers (VPS), but for those types of servers, you might want to look at the ipcountryblock package instead as that one is capable of blocking countries from the entire server so that they have no access whatsoever. That package makes use of the Linux kernel's iptables to perform the blocking.

Web sites running on shared servers can use this package. But keep in mind, this only protects your web site. It doesn't protect ftp access, email access, or various other services. However, protecting your web site is the first step in blocking out the idiots in this world. Once you've blocked them from your web site, they will have less of a chance of learning how to access anything else on the system your web site is running on. For instance, if they can't find email addresses listed on your web site, they will have less of a chance at spamming you.

Installing this package is very easy, and once installed, it works very efficiently at blocking as many countries as you would like to. Once you are up and running, the work of blocking countries is handled by a program called "countrycheck.php". It is called from your .htaccess file by using some rewriting rules.

This package also includes a handy utility called iptocountry.php that lets you look up an IP address and identify the country it belongs to as well as the entire range of addresses it falls within. If you look through your log files and find some IP addresses that are causing you problems, you can look them up with iptocountry.php to find out the country they are coming from. You can then add that country to the list of countries to block, if desired.

Next Previous Contents