[Plugin] IP Blocker

I tried a "real" IP, have to admit, I did try a random IP number at 1st try then I tried one I knew was a legit IP
as I under stand, it wont show in the user interface?, but should be listed in the .htaccess
 
Very odd. I'm going to add the ability to do blocks of IPs anyways, so while I'm at it, I'll see about it spitting out general information for debugging problems like this. That'll help us diagnose what the actual problem is as I haven't seen this problem before.

What version of PHP do you run? Depending on that, that might explain why v1.6 didn't work for you.
 
Last edited:
php 4.4.6
yea I know should be at 5.x but have some clients still needing 4.x looking into running both
 
php 4.4.6
yea I know should be at 5.x but have some clients still needing 4.x looking into running both
hmm. Might be why the problem hasn't popped up for anyone else yet. Most people are either running 5.x or both PHP 4 AND 5. I think I MIGHT know what the problem is for you, but it's not documented, so I'm not 100% sure. I'll get a beta up soon (hopefully tomorrow) for you to test out to see if it fixes the problem. :)
 
Thank You
thought this would be nice for the users, most dont know about .htaccess or how to add to it themselves..:)
 
After jumping through some hoops, we finally got everything situated. The script now works fully with PHP4 (didn't realize one of the functions was PHP5-only) and you can block blocks of IPs ("192.168." to block all IPs from 192.168.###.###) as well as domain names (for blocking ISPs and such). It no longer checks the IP field for a correct IP, but that the entry is at least 5 characters long, so make sure to be careful when adding.

To update IP Blocker:
Go to the Plugin Manager page > Check off the IP Blocker plugin > Type in the password > Click the Update button

That's all there is to it!
 
Last edited:
Dravu
Thanks SOOO much for all your work, This works great and I appreciate it.
It will create the .htaccess file if one isn't present and also will add multiple IP's all at once, just add a space between them :):D
 
Error 500

Any idea why after I block any IP, my site forbids all traffic? I get error code 500.
 
Try deleting or re naming the .htaccess file , I see this when the file is corrupt or you use an editor that puts extra characters or spaces.

then try again
PS saving the existing file will allow you to copy the IP's you have


Any idea why after I block any IP, my site forbids all traffic? I get error code 500.
 
Any idea why after I block any IP, my site forbids all traffic? I get error code 500.
As mentioned above, you must've entered incorrect information and corrupted the .htaccess file. If you copy and paste the contents of your .htaccess file here after you try blocking an address, we can try and help find out what's causing the problem.
 
It doesn't matter what I enter in the .htaccess as soon as I have it in the public_html I get the error 500. Is there something in httpd.conf that controls that?
Code:
order allow,deny
allow from all

As a side note my .htaccess file was created and edited via ssh using touch and nano. I am using Apache web server. The file permission is 644. Is there an Apache setting that would be causing this?

Ok I fixed it. I had to change AllowOverride in /etc/httpd/conf/httpd.conf to AllowOverride All.

I hope this helps anyone else in the future.
Thank you guys for all your responses
 
Last edited:
IP Blocker

When this is used by DA Administrator, does it block the IP address server wide or does each individual account user need to use it to block IPs?

tia
 
When this is used by DA Administrator, does it block the IP address server wide or does each individual account user need to use it to block IPs?

tia

This plugin uses .htaccess files which only affect each domain/user. It's generally advised to use a firewall if you want to block something serverwide, especially if you want to keep the connections from happening period (this plugin allows the IPs to still access the server. They just get a "forbidden" error page for everything).

AndyII linked to the thread for CSF and that's what I personally would recommend for your firewall. Since they added support for Directadmin, it's been a great piece of software.
 
I'm grateful to you guys for the concise help - Andy & Scott at Servertune have fixed me up. This is a great forum with very helpful people. Wish I had something to give here instead of only taking.

L Seawell

P.S. - The IP Blocker addon is very sweet and will be a nice gift to my customers. Thanks for that.
 
Last edited:
From what I've read and seen in the very first message of this thread, it has nothing to do with a version of Directadmin, but there might be issues with running the plugin with PHP 5.3/5.4.

I don't use the plugin myself, so that's only my guess based on my experience of using Directadmin and it's plugin system.
 
Hi, I saw this old topic which is interested for me.
I have PHP Version 5.3.18 on my server and I try to install version 1.7 which you mentioned that is work with php 5.3 but the links are broken.
I try version 1.8 from this link : http://dravu.com/directadmin/ipblocker.tar.gz it install but whenever i go to the user page and click on IP Blocker, it takes a lot of time and do nothing. I mean no page will display after that.

would you please help me to solve my problem?

Thanks

Version 1.8:
- Changed a few things to make the script backwards compatible with PHP4
- Made it display errors if the .htaccess isn't writeable or if the entries were incorrect
- Added the ability to block blocks of IPs ("192.168." to block all IPs from 192.168.###.###) as well as domain names (for blocking ISPs and such)
- Removed the check for invalid IPs. Now it only checks that the entry is at least 5 characters long. Be careful.
http://dravu.com/directadmin/ipblocker.tar.gz
http://www.johannesspringer.at/dwnld/ipblocker.1.8.tar.gz

Version 1.7:
- Changed a few functions due to becoming deprecated in PHP 5.3 and PHP 6
http://www.johannesspringer.at/dwnld/ipblocker.1.7.tar.gz
 
Back
Top