Blocking Countries From Viewing Site?


#1

I’d like to block visitors from certain countries from viewing a site I have on a Dreamhost VPS. I know this can be done via Cloudflare, but the site is not compatible with Cloudflare’s requirements, so I need to do it another way.

I’ve seen talk elsewhere about mod_geoip, but I can’t work out if it is already installed, or if not then what I need to do to install it.

Any help with mod_geoip or another approach to so this is very welcome. Thank you!


James


#2

you can use MasterMind’s geoip database in your app. I use the PEAR module for it to identify my user’s locations.


#3

"but the site is not compatible with Cloudflare’s requirements, so I need to do it another way."
I was just wondering if you could clarify this. Do you mean the www requirement when signing up through the Dreamhost panel option?


#4

Bobocat - Many thanks for your recommendation re MasterMind. I’ll take a look.

damoncloudflare - Thanks for asking. Actually it’s that many of our pages contain video streaming so I understand the site can’t be supported by Cloudflare. That’s a shame as I have other sites on DH that are supported by Cloudflare and working well (but those aren’t the ones that need country-based viewing restrictions unfortunately).


James


#5

"Actually it’s that many of our pages contain video streaming so I understand the site can’t be supported by Cloudflare."
Ah, thanks for clarifying. You can still actually use CloudFlare for the site in that circumstance, but you would want to make sure the streaming content is on a subdomain we don’t touch(something like stream.yourdomain.com). If you were able to move the streaming content to a sub…then no issues at all on our end.

"I’d like to block visitors from certain countries"
You could also look at setting some rules in .htacess to do this (another alternative).