vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Blocking specific countries from your site (https://vborg.vbsupport.ru/showthread.php?t=299776)

John Lester 07-03-2013 09:34 PM

Blocking specific countries from your site
 
Maybe I'm just not understanding things here so bear with me :D How come there isn't some simple way to block countries by using their two digit country code? I mean all ips resolve to a specific country right? So how come there isn't a script (or better yet something to put into htaccess) that checks the ip and then blocks it if the country id code is tagged for blocking?

ForceHSS 07-03-2013 09:41 PM

<a href="http://incredibill.me/htaccess-block-country-ips" target="_blank">You can block them from the htaccess file</a>

nhawk 07-03-2013 09:44 PM

If you're on a dedicated server you can also look into mod_geoip.

That will let you deny access using the country code.

John Lester 07-03-2013 09:54 PM

Quote:

Originally Posted by ForceHSS (Post 2431943)

I looked into doing it by ip (all that site does is generate a list of ips) ... but damn that's 100's of ips and slowed the site down a little.

--------------- Added [DATE]1372892164[/DATE] at [TIME]1372892164[/TIME] ---------------

Quote:

Originally Posted by nhawk (Post 2431945)
If you're on a dedicated server you can also look into mod_geoip.

That will let you deny access using the country code.

I looked into geoip but I'm on a VPS and the host told me to use CSF or something ... but the one they installed doesn't have the "block by country" setting :(

snakes1100 07-03-2013 10:38 PM

csf does have cc_deny & has for a long time, just use the country codes, comma delimited values.

Spangle 07-04-2013 01:42 PM

Quote:

Originally Posted by John Lester (Post 2431940)
Maybe I'm just not understanding things here so bear with me :D How come there isn't some simple way to block countries by using their two digit country code? I mean all ips resolve to a specific country right? So how come there isn't a script (or better yet something to put into htaccess) that checks the ip and then blocks it if the country id code is tagged for blocking?

Have you looked at the IP deny manager in the Cpanel, you can deny IP ranges or parts of or all of by using ***

John Lester 07-04-2013 04:14 PM

Quote:

Originally Posted by snakes1100 (Post 2431951)
csf does have cc_deny & has for a long time, just use the country codes, comma delimited values.

I only see options to block by ip, is there a module in csf specifically for cc_deny that needs to be enabled?

snakes1100 07-04-2013 05:26 PM

@John, Did you check in csf.conf? Should be around line 447

@spangle, its better to use iptables or apf, as these checks for IP banning are done at the server level, not by a deny via apaches htaccess, especially when you list huge lists of IPs, its going to kill apache.

tbworld 07-04-2013 09:25 PM

In most large companies we use hardware firewalls to handle this. I know this is not useful information for most, but maybe an explanation on why there is not more sophisticated tools for the small guy. if on a shared server the best you can probably do is some sort of cpanel option, if they have it. if not then set some kind of IP filtering on vbulletin directories like ht-access. Of course it can be done in vbulletin, but this really isn't desired -- you don't really want them to get that far in. If the program is inefficient it can add significant server load and maybe even killing the server as @snake said.

I serve my daughters board over FIOS connection (which gets hammered) and I use a separate firewall for her server. You just need to purchase a descent enough firewall to handle this kind of option. Now I just monitor the IP's that get through to the server using any of the many server tools for doing this. I tried not to reinvent the wheel here.

If your a dedicated server, then there are some good solutions. I agree with @Snake.

John Lester 07-04-2013 11:35 PM

snakes I don't see that file (probably don't have access to it :D ) so I'll ask the host and see what they say :)

Ty for the info tbworld, if I ever have a dedicated server I'll keep in mind the hardware firewall :)

--------------- Added [DATE]1373045497[/DATE] at [TIME]1373045497[/TIME] ---------------

I have another related question, if I block a country via csf (assuming the host allows this) can I have an exception for specific ips?


All times are GMT. The time now is 11:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02361 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete