A site for both the WebMaster and the WebUser
HTCountryBlock Package
for web sites running
on shared servers
NOTE: If you have control of the entire machine your web site is running on (i.e.
dedicated server) and you'd like to block countries from every service running on that machine,
not just your web site, you might want to check out the IPCountryBlock page instead.
This package provides you with the tools you need to block countries from having access to your
web site pages and other files if your site is running on a shared server. This is very easy to
install and includes detailed and easy to follow instructions. If you have the ability to
create a couple of new directories on your site, upload files, and make a couple of simple
edits in a text editor, then you can easily get this package running. Once you install this,
you will be able to sleep better at night, knowing you don't have to keep a constant watch on
idiots trying to advertise their stupid web sites in your forums or blogs or hackers trying to
hack your web site. You can't keep the entire world out, obviously, but you can at least block
the countries you don't need. And most of the ones you don't need are the ones causing all the
trouble.
December 7, 2009 changes: Fixed an annoyance when someone tries to
use a goofy URL. Added ability to have more than one filename used for the default index files.
Added a test method to make sure country blocking is working. Simplified the .htaccess code.
All existing users should want to upgrade to this.
December 20, 2006 changes: A minor fix in the countrycheck.php file
to eliminate PHP offset warnings in the error log during a file not found error. Not really a
problem, just cluttered up the error log.
December 17, 2006 changes: The first official release of this
package.
updated December 7, 2009
countryhtblock11.tar.gz - 27K - Almost everything you need in
one tar.gz archive including the documentation. Read the README file after unpacking this.
countryhtblock11.zip - 56K - Contains the same files, but
in .zip format. Read the README file after unzipping this.
If you'd like, you can also read the documentation here online
before downloading.
Don't go away... you need one more file.
You'll need to pick your choice of database files, either the "ip-to-country" file or
the "geoip" file. These contain all of the IP address and country information. You
only need one or the other. Or you can download both and set up two different directories to
try this out in and then settle on the one you like best.
You can download the "ip-to-country" file for free from ip-to-country.webhosting.info.
From the main page, go to the download section and look for the database file called
"ip-to-country.csv". It will be a .zip file. Unzip it into the same directory where
you placed the .php files from here.
Or you can download the "geoip" file from www.maxmind.com. Look for the free download
called "GeoLite Country". Get the .csv version and not the binary version. You can
also use their "paid for" version if you choose to do so.
The files you download from here are very small, but the .csv database file is about 3 MB - 6MB
(depending on which one you select) and the database files that will get created will take up
another 3 MB - 6MB, approximately.
Go ahead and have fun locking your doors. Unfortunately, this world of ours requires it.
|