Prevent server beeing flooded with requests
I'm hosting a Wordpress-blog on an Apache server (shared hosting). For some reasons I've been receiving like 100 requests per second to xmlrpc.php for a few days.
The access.log looks like this:
...
188.138.33.149 - - [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-" "GoogleBot/1.0"
188.138.33.149 - - [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-" "GoogleBot/1.0"
188.138.33.149 - - [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-""
...
In the .htaccess I applied the following rule:
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
Is there a better way to prevent the spam?
Solution 1:
If most of your spam connections are comming from a small number of IP's you may block only those IP's from your .htaccess as described in this link.