Your system must be running a web server such as Apache on a Linux server for the iptables functionality of this package. It also must have php4 (or higher) installed. If you use another operating system that uses the same iptables functionality as Linux, then this might work for you as well. I've found that the 2.6.x Linux kernel is needed for this package because it uses the iprange module with iptables. If you've been able to get iprange to work with iptables on a 2.4.x kernel, then you are in luck. I personally gave up and upgraded to the 2.6.x kernel. I think some of the newer 2.4 kernels can use the iprange module.
Without iptables running or if you use another type of operating system that doesn't use iptables, you can still use part of this package as long as you have php running on your system. The iptocountry.php program will be very useful in helping you to determine the country an ip address belongs to as well as the countries that are immediately before and after the ip range of the particular country.
If you've downloaded the complete countryip.tar.gz package, then you have this documentation and the 3 php files needed. You will also need one more file which contains all of the country and ip address info.
You have your choice of two different databases.
One can be downloaded from http://ip-to-country.webhosting.info. This file is called ip-to-country.csv and can be found in the downloads section of their website. On the website, the downloadable file is called ip-to-country.csv.zip.
The other one can be found at http://www.maxmind.com. This file is called GeoIPCountryWhois.csv once it is unzipped. In it's zipped format when you download it, it is called GeoIPCountryCSV.zip. It's also found as GeoIP-lite on the site. This is the free download. You can also use their more accurate GeoIP file from their paid service. Be sure to get the .csv version and not the binary version.
Whichever file you choose, be sure to unzip it and copy it to the directory you will be using for this package.
The file you download from one of these two souces is used just one time during the initial setup. The information database is built from the file and is used for the operation of the programs in this package.
However, once you begin using this package, you will want to check periodically for new updates to the database file that you choose to use. Both database files are updated approximately every month or so.
NOTE: For the rest of this documentation, the country database file you have chosen to use will be referred as the ".csv database file".
Here's a brief summary of what you need to do to get this entire package running:
Optionally (or instead): Run iptocountry.php to look up countries according to their IP address.
For a much more detailed installation description, keep reading...