Go Back   HostGator Peer Support Forums > Public Forums > Suggestions

Notices

Reply
 
Thread Tools
  #1  
Old 05-03-2007, 01:23 AM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Ability to block countries (mod_geoip)...An extra feature that would be great to have

It would be fantastic to have an easy to use tool to block entire nations from accessing our sites!

Let's face it, we all have traffic from parts of the world that is just useless and costs us bandwidth.

And sometimes it is worse than usless....
It's a pain in the buttocks !!!

For example I have had problems with scam and con artists from Albania and several African nations. I can't sell to these nations and with my business model I can't see how I can do business with them in the future.

So locking out Albania and Africa would be an ideal option for me.

So how about it ?
Reply With Quote
  #2  
Old 05-03-2007, 01:46 AM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

You can use .htaccess in other ways to block countries-- do it by IP range:
Code:
order allow,deny
deny from 43.23.23.23
allow from all
Leave off octets to block all in a matching octet.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #3  
Old 05-03-2007, 06:39 AM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by slapshotw View Post
You can use .htaccess in other ways to block countries-- do it by IP range:
Code:
order allow,deny
deny from 43.23.23.23
allow from all
Leave off octets to block all in a matching octet.
Doing it in your .htaccess file isn't very practical.

The list of IP addresses could be huge; I believe China is about to overtake the US, but either way, the list is very big. And as you know, IP address blocks are de-allocated and re-allocated fairly frequently.



On that note...
Even the smallest countries are going to have a very large range and doing it your way might mean I also block nations I don't want to block.

Denmark for example has apx. 5.5 million people.
If I simply deny access to anyone with an IP starting with 43.23.
I might end up locking out a portion of Sweeden, Germany or even Norway.
Reply With Quote
  #4  
Old 05-03-2007, 08:31 AM
Hostalot Hostalot is offline
Baby Croc
 
Join Date: Mar 2007
Posts: 92
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

The standard way of blocking countries is to load the free geoip database from maxmind into MySQL and then write a geoip PHP script. Thatīs best working method of blocking at the country level. However as people in the UK (just an example) may actually log into their ISP in the US the blocking wonīt be perfect, but itīs as close as it gets.
__________________
A review directory of cheap web hosting providers
Read my Hostgator review before you sign up
Listings of the cheapest web hosting providers
Reply With Quote
  #5  
Old 05-03-2007, 08:58 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by Hostalot View Post
The standard way of blocking countries is to load the free geoip database from maxmind into MySQL and then write a geoip PHP script. Thatīs best working method of blocking at the country level. However as people in the UK (just an example) may actually log into their ISP in the US the blocking wonīt be perfect, but itīs as close as it gets.
This is far better than .htaccess blocking, which can really slow a site down.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #6  
Old 05-03-2007, 09:46 AM
ebell ebell is offline
Hatchling Croc
 
Join Date: Nov 2006
Posts: 4
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to have

Have you considered that these hits could be valid customers using proxy servers?
Reply With Quote
  #7  
Old 05-03-2007, 11:17 AM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to have

Quote:
Originally Posted by ebell View Post
Have you considered that these hits could be valid customers using proxy servers?

The number of people using the SAME country proxy server is going to be very very low.

Especially considering the number of people who actually use proxies isn't exactly stellar.

Free proxies vanish and reappear on a regular basis. ie: One day you're logging in from Canada and the next day it's Botswana.

---------
The other great advantage with GeoIP is that you have the possibilty of redirecting your unwanted traffic to a site that can use it..... Possibly getting someone to PAY YOU for the traffic in the process.

--------
hostgator has a wonderful cpanel.
Why not included the geoip blocking ?
It would really be a great feature !!!

Quote:
Originally Posted by Serra View Post
This is far better than .htaccess blocking, which can really slow a site down.
OH YEA... Waaaaaaaay better!
I once saw a .htaccess file that blocked Turkey. It was 100s of lines to do it right.

Last edited by Leggyred; 05-03-2007 at 11:20 AM.
Reply With Quote
  #8  
Old 05-03-2007, 12:39 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

I know IP blocking sucks-- however, my point was that HG doesn't have this installed currently, so until they do, I'm not sure how else you can do it.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #9  
Old 05-03-2007, 02:40 PM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by slapshotw View Post
I know IP blocking sucks-- however, my point was that HG doesn't have this installed currently, so until they do, I'm not sure how else you can do it.
There is stuff out there.
Mod_Geoip from mastermind. (it's free)

But the installation is beyond my technical know how....

(anyone want to make a few bucks ? I can pay via paypal)
Reply With Quote
  #10  
Old 05-03-2007, 02:50 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

There's no way you're going to be able to install this yourself on the shared servers, whether you know how to or not. You *may* be able to get HG to do it for you; I'd file a ticket asking them. With a dedicated you could install whatever you want.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #11  
Old 05-03-2007, 02:55 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

EDIT: slapshotw posted while i was replying
Reply With Quote
  #12  
Old 05-03-2007, 03:37 PM
Hostalot Hostalot is offline
Baby Croc
 
Join Date: Mar 2007
Posts: 92
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by Leggyred View Post
There is stuff out there.
Mod_Geoip from mastermind. (it's free)

But the installation is beyond my technical know how....

(anyone want to make a few bucks ? I can pay via paypal)
Letīs dig out this link to maxmind

Complete with documentation on how to load the .csv into your mysql database and write a php script to compare incoming ips with the db. And yes it's very feasible to install this on a shared account unless you get tons of traffic in which case it may get a bit ugly.

With regards to installation. You may find someone to do this for you at getacoder or elance but make sure you donīt give them your account login etc.
__________________
A review directory of cheap web hosting providers
Read my Hostgator review before you sign up
Listings of the cheapest web hosting providers
Reply With Quote
  #13  
Old 05-03-2007, 04:34 PM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by Hostalot View Post
Letīs dig out this link to maxmind

Complete with documentation on how to load the .csv into your mysql database and write a php script to compare incoming ips with the db. And yes it's very feasible to install this on a shared account unless you get tons of traffic in which case it may get a bit ugly.

With regards to installation. You may find someone to do this for you at getacoder or elance but make sure you donīt give them your account login etc.

My idée is to have somone walk me through the process.
That way I can learn and do it for myself later.

But I still think it would be a great feature to have in cpanel.
Reply With Quote
  #14  
Old 05-03-2007, 05:35 PM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,924
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by Leggyred View Post
But I still think it would be a great feature to have in cpanel.
It's too advanced for cPanel... people would end up blocking the wrong IPs and probably not know it...
Reply With Quote
  #15  
Old 05-04-2007, 12:07 AM
BobA BobA is offline
Hatchling Croc
 
Join Date: Jan 2007
Posts: 41
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to have

Against my better judgement (and obviously others opinions) I'm still using .htaccess for country blocking. Since my site is for a very small group of US business and 90% of attempted attacks come from outside the US, I block out practically every other country.

Currently I have 200 lines of country code letters and 300 lines of IP addresses including full blocks in the .htaccess file. The 500 line file is 17KB and it has not slowed down access to my site.

I monitor my logs daily and perhaps need only to add 1-2 IPs per day.... sometimes I actually reduce the number of lines by replacing full IP address by leaving off octets to block all in a matching octet. The .htaccess blocking has been quite effective and I just love seeing those 403 errors..... most give up and never return but some are stubborn!
Reply With Quote
  #16  
Old 05-04-2007, 01:19 AM
Leggyred Leggyred is offline
Hatchling Croc
 
Join Date: May 2007
Posts: 20
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by kmaw View Post
It's too advanced for cPanel... people would end up blocking the wrong IPs and probably not know it...
It would be blocked by nation and not by individual IPs.
Reply With Quote
  #17  
Old 05-04-2007, 08:40 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by BobA View Post
Currently I have 200 lines of country code letters and 300 lines of IP addresses including full blocks in the .htaccess file. The 500 line file is 17KB and it has not slowed down access to my site.
You are incorrect, but you may do as you wish. When there are no problems and you are on a powerful server, a 500 line .htaccess file will not have any effect on speed.

If the server gets a little bogged down, you change servers or other factors effect your server, your site will crawl while other's will be passable.

Putting those in your .htaccess is a VERY bad idea, but it is not technically wrong.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #18  
Old 05-04-2007, 09:02 PM
charlesgan's Avatar
charlesgan charlesgan is offline
Swamp Croc
 
Join Date: Mar 2007
Location: http://www.hostgatorreview.org/
Posts: 372
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to have

i come across somewhere online forum, there is people posting php script just to do that. blocking by region/ip range.

i not manage to find the code. sorry.

last time i coded in asp before, with a huge database of IP range to check with.
__________________
Charles Gan
Hostgatorreview.org
Reply With Quote
  #19  
Old 03-21-2008, 02:55 PM
makaveli0129 makaveli0129 is offline
Hatchling Croc
 
Join Date: Mar 2008
Posts: 1
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Now if I wanted to Allow only a specific DNS suffix how would i do that in html?
Reply With Quote
  #20  
Old 03-21-2008, 04:22 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Ability to block countries (mod_geoip)...An extra feature that would be great to

Quote:
Originally Posted by makaveli0129 View Post
Now if I wanted to Allow only a specific DNS suffix how would i do that in html?
That isn't really possible in html, you could do it in php fairly easily.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 03:16 PM.