In my Apache, I have a long list of IPs to be blocked (for some reasons). And then I'm currently putting those rules inside the .htaccess
files of the each and every single docroot (domains) I have.
The rules look like this:
SetEnvIF X-Forwarded-For "1.2.3.*" DenyIP
SetEnvIF X-Forwarded-For "100.200.*.*" DenyIP
..
..
..
..
..
..
Order Deny,Allow
Deny from env=DenyIP
These same .htaccess
files are now located like:
/var/www/html/www.site-a.com/.htaccess
/var/www/html/www.site-b.com/.htaccess
/var/www/html/www.site-c.com/.htaccess
/var/www/html/www.site-d.com/.htaccess
/var/www/html/www.site-e.com/.htaccess
/var/www/html/www.site-f.com/.htaccess
/var/www/html/www.site-g.com/.htaccess
..
It works that way. But then whenever I have to update the IPs, I have to edit in all of these files.
Question:
How do I apply these common rules Server-wide (Apache-wide), so that they are applied on every single websites docroots (domains) I have in my Apache?