Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've gone through the trouble of blocking a number of bots that are trying to crawl our site. The issue now is that the following error is taking over the apache error log:

client denied by server configuration

I was hoping that an Apache expert out there can tell me how I can suppress the error message for this specific issue from being written to the error log.

Thanks in advance for your help!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

grep -v

Really. I mean it. Why manipulate the logs at time of writing?

Edit 1

tail -f -n100 /var/log/httpd/error_log | grep -v 'client denied by server configuration'

If you really want to prevent the error from being written to disk, you can pipe your logs through a script. More details here:

Apache docs

share|improve this answer
    
@Warner - Fair enough. Any ideas how I can change the following command I currently use to view the log file so that it suppresses those errors? tail -100 /etc/httpd/logs/error_log –  Russell C. Mar 5 '10 at 2:06
    
@Warner - Thanks! That seems to produce something slightly different since it first grabs 100 lines of the error log and then only shows non-matching lines. Is there a way to instead display the last 100 lines that don't match? –  Russell C. Mar 5 '10 at 2:32
    
Try this: grep -v 'client denied by server configuration' /etc/httpd/logs/error_log | tail -n100 –  Warner Mar 5 '10 at 2:37
    
works great. Thanks for the help! –  Russell C. Mar 5 '10 at 14:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.