List incoming live requests

In order to list all incoming requests to get a hang of what’s happening with your server in real time you can use the command bellow. Make sure you have enabled mod_security audit. Because I use whm/cpanel this was possible using the whm panel. Just log in to whm and then in Plugins->Mod Security add:


# RelevantOnly
SecAuditEngine On

SecAuditLogParts ABZ

I choose to display Referer, GET, From and Host part of the request. In this way I can quickly see the referrer of the request and also if the request was made by a robot like google, bing or yandex

tail -f /usr/local/apache/logs/modsec_audit.log | grep -v .swf | grep -v .jpg | grep -v .css | grep -v .js | grep -v .png | grep -v .gif | grep -v .ico | grep -v .txt | grep -A9 GET | egrep 'Host|Referer|GET|From|^--$'