MyBB Community Forums

Full Version: Banning IP Address
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a big list of IP Address that I need to banned from my new board I just installed. There's only the option of adding one at a time. Well it would take me weeks to add all of these IP Address. I need a update for this. Or my web site will get hit like crazy from spammers.

Just add into .htaccess as deny rules.
deny from 127.0.0.1

Use that code in your htaccess and save it. Replace 127.0.0.1 with the block lists, one by one.
No, if it's a big list, that's will slow your website as apache will read htaccess at each request.

I have saw in the past something similar but for EMAILS, try a search you will find an MySQL Query for adding all of them easily (just change the Insert into "mybb_banned... By the IP banned table) also there a php script for emails you can adapt for IPs.
I suppose you could do a foreach loop, and insert into the database from a list or text file.
(2012-02-29, 10:21 PM)Babar Wrote: [ -> ]No, if it's a big list, that's will slow your website as apache will read htaccess at each request.

I have saw in the past something similar but for EMAILS, try a search you will find an MySQL Query for adding all of them easily (just change the Insert into "mybb_banned... By the IP banned table) also there a php script for emails you can adapt for IPs.

I've run apache with 5000 lines in htaccess and it was just fine. It's actually probably faster than running them in the php.
(2012-02-29, 10:21 PM)Babar Wrote: [ -> ]No, if it's a big list, that's will slow your website as apache will read htaccess at each request.

I have saw in the past something similar but for EMAILS, try a search you will find an MySQL Query for adding all of them easily (just change the Insert into "mybb_banned... By the IP banned table) also there a php script for emails you can adapt for IPs.
No. You're wrong. If so was the case, big companies and websites would be slow like anything. I myself have more than or around 1K of denied IP blocks in htaccess and it runs smooth.
Lol, you can't say i'm wrong, it's a point of view, it's better to tell that, as you don't have the saint graal truth, all depends of the config, if you running a 24GB 8 cores hp xeon with 2gbps, for one website (it's an example don't matter whats the config is, remember its an e.g & pov), yea you won't get slow adding some lines in htaccess, and big companies block at the top, in the hardware firewall, they don't use htaccess for blocking ip, sysop have thing like reverse slowloris for spammers/ddosers.. but that's another subject and prices..

he (OP) have a lot of choices, if he want to block them registering, and just looking, go on the mybb system

I've read lot of doc about htaccess slowing system if you put too much info in it. Never tried to put 8000 lines, but if you google about it, you will find some sources and forums.

Why don't block in iptable directly ? Better i guess.

He can also subscribe to cloudflare pro ($20/month) and block directly in cloudflare. I use it also, never got in trouble, but cloudflare don't have all IPs of all countries, like Russia, they miss some IPs, but you can add block (.0/24) without problems.

(ps: maybe he don't have a dedicated server, so what will happen for a shared hosting.. yesterday a guy there got problem with a slow install of myb1.6.6 - fresh one just on a shared..)
I have 5000-6000 in my htaccess on shared hosting, and i could not tell the difference between before and after.

I'm not going to say what you've said is 100% false, but it isn't really 100% true either.
(2012-03-01, 03:25 PM)GamerVoid Wrote: [ -> ]I have 5000-6000 in my htaccess on shared hosting, and i could not tell the difference between before and after.

I'm not going to say what you've said is 100% false, but it isn't really 100% true either.

Yes thanks for pointing that out, this is exactly how this work, we all share a pov, as some host have really bad side, and others are really good and can handle this without problem. Smile
Pages: 1 2