If a particular user is abusing your Apache web server, it is quite easy to deny access to your site. We found (with our ISP) that the easiest is to put an entry in the .htaccess file in the root of the directory you want to protect:
deny from xxx.xxx.xxx.xxx
Where xxx.xxx.xxx.xxx is the offending users IP address. At NetAdminTools, we are usually quite forgiving, but we had an obnoxious client using Offline Explorer that was causing us performance problems and polluting our logs. The problem with mirroring, is that cross links aren’t always dealt with correctly, so you end up with nasty loops. Once we denied access, though, we had to clean up our logs so our stats weren’t skewed and our logs didn’t use up all of our web space. We wrote a little shell script called cln.sh that contains:
perl -i remlns.txt access_log
perl -i remlns.txt error_log
Then, we simply run:
and presto, all references from the offending user are gone and our logs are useful again.
The script remlns.txt is discussed in this article. It just matches two distinguishing features of the line (text1 or text2) and removes the line if either feature matches. Make a backup of your logs first if they are important and test on a non-production box, etc.