On 01/14/2011 07:10 AM, Norman Peelman wrote:
Hello all,
I've got a server with name based virtualhosts. I am getting spammers
from various countries and would like to block these IP ranges. But I
can't seem to figure out how to block them. How can I block them by
default for the entire server? Where do I put the:
<Directory>
Order Allow,Deny
Allow from all
Deny from ip range
...
Deny from ip range
</Directory>
I've tried putting them in the main apache.conf and in an .htaccess
file (in a vh) but I still see the spammers logging on and spamming
from ips' in the list.
Thanks for any help steering me in the right direction.
Norm
You could use mod_geoip, though I have never tried it.
I have written an article on the same thing, blocking ips by countries
to the whole of server, not only apache at
http://www.itech7.com/Firewall/Blocking-IPs-by-country-using-IPSet-and-IPTables
In case you chose the second one, just ensure that you run depmod after
make install. If ipset command says 'module not found' or something
similar run modprobe ip_set and add ip_set to the list of modules to be
loaded on boot.
[Sorry I'm not advertising my website, its an original article]
--
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
" from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org