Blocking IPs fail
I'm a hosting reseller on a dedicated server. The server was recently upgraded and now runs apache 2.4, CloudLinux and cpanel 68.0.33. Prior to the upgrade, blocking an IP via the IP Deny Manager would work. Now it doesn't. What IP's are entered are added to the .htaccess file but the IP still gets through.
My host has not been able to resolve this issue. I read on the web that the new Reserved should be used so I tried that - still didn't work. If I add the IP to the servers CSF the IP will be blocked. Below are some of the variations I've tried to block an IP using the .htaccess file of the account. Does anyone know of a reason for this not working?
Require all granted
Require not ip 171.25.193.27
Order Allow,Deny
Deny from 171.25.193.27
Allow from all
order deny,allow
deny from 171.25.193.27
-
Hello, Could you ask your hosting provider to let us know of any output to /usr/local/cpanel/logs/error_log when using the "IP Blocker" option to add a new blocked IP? Also, what are the permissions/ownership values on the account's .htaccess file? Thank you. 0 -
There aren't any errors in that log and the permissions are -rw-r--r--. I tried adding my own IP via IP Deny Manager to test for errors and found that I wasn't blocked. But I noticed that cpanel only adds the line deny from IP# to the .htaccess file. So I removed all of the , order... and allow from statements, leaving only deny from statements and all of the blocking started working. As a test, I added this: deny from my IP order deny, allow deny from some other IP allow from all The above allowed me to view the site. Changing the above to the following blocked me again. deny from my IP deny from some other IP Are those commands no longer valid? Or is there some module that needs to be installed in this version of apache/cpanel that isn't done automatically? 0 -
You might like to try the apache 2.4 method eg Require all granted Require not ip 10.252.46.165
That should block access from 10.252.46.165 and allow everyone else. I have had mixed success using these newer formats (but it was probably my fault for getting syntax wrong) More details from Access Control - Apache HTTP Server Version 2.40 -
Hello, Feel free to have your hosting provider open a support ticket with us using the following URL: Create Support Ticket - Version 68 Documentation - cPanel Documentation This will allow us to take a closer look at the system to verify why it's not blocking the IP addresses. Thank you. 0 -
This appears to be working now. There was a notice in WHM saying a reboot was needed to apply changes from the last update. Once that was done, the problem went away. No way to know if it was due to some setting in cpanel not being applied or just something hung up on the server, though the latter is probably correct. My thanks for the help and apologies for wasting time on this. 0
Please sign in to leave a comment.
Comments
5 comments