blacklist ips with apache conf (instead of .htaccess)
setup/enable ip blacklist (only once!)
add to existing blacklist (as needed)
- create/edit blacklist file using the command
sudo nano /etc/apache2/ipblacklist.conf. for each address you want to block, create a line with
Require not ip <address>, e.g.,
Require not ip 188.8.131.52. You can also add multiple addresses on one line separated by spaces, but it's harder to change/manage later.
(thanks to https://confluence.jaytaala.com/display/TKB/Securing+Apache+and+blocking+a+list+of+ip+addresses)