This looks like it would do what you need. Not used it myself, but Maxmind have been around for a LONG time and are well known in the GEO IP field... http://www.maxmind.com/app/mod_geoip
Whats the environment this is in? The best way is network level so routing or firewall. Next is software firewall level on the server, and finally yeah software level so apache (htaccess or mindmax style).