GeoIP

sspt

Verified User
Joined
Oct 27, 2005
Messages
63
Hello,
I've installed GeoIP and mod_geoip2 to try to block some countrys and i've found how to block it for all domains but i just want to :
Deny BR, RU, CH <=> vhost x
Deny US, FR, ES <=> vhost y
Allow all <=> vhost z

Anyone know if it's possible?

Kind regards,
 
I've found that code will redirect Canada users to another site:
GeoIPEnable On
GeoIPDBFile /etc/GeoIP.dat

RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com [L]
How can i instead of redirect ppl from CA, i only allow ppl from Canada enter into the site?
 
it comes with a README file, and the blocking example from this:

# This blocks traffic from China and Russia

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry
# ... place more countries here

Deny from env=BlockCountry


(with a little hacking, you can construct
an 'Allow from...', of course ..)
 
squirrelhost said:
it comes with a README file, and the blocking example from this:

# This blocks traffic from China and Russia

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry
# ... place more countries here

Deny from env=BlockCountry


(with a little hacking, you can construct
an 'Allow from...', of course ..)

I've already tried it but i receive this:
Starting httpd: Syntax error on line 47 of /usr/local/directadmin/data/users/xpto/httpd.conf:
deny not allowed here

I think i can't deny nothing into a vhost :(
 
Back
Top