clarkk Asked: 2011-07-07 00:31:19 +0800 CST2011-07-07 00:31:19 +0800 CST 2011-07-07 00:31:19 +0800 CST disable error.log for specific directory 772 how to disable error reporting to error.log in Apache for a specific directory (phpmyadmin) ? in httpd.conf in .htaccess apache-2.2 1 Answers Voted Iain 2011-07-07T02:11:17+08:002011-07-07T02:11:17+08:00 For the errorlog there is no built in way to achieve this. You could use log piping to do this by piping the log messages to something that will ignore messages containing some specified string. Define a pipe to handle the error log ErrorLog "|/usr/local/bin/httpd_errors >>/var/log/apache2/error.log" The contents of the httpd_errors script can be as simple as #!/usr/local/bin/perl $|=1; while (<STDIN>) { $ErrorMessage=$_; if ( $ErrorMssage !~ 'phpmyadmin' ) { print $ErrorMessage; } } This waits for messages to arrive on stdin and only prints them if they do not contain the string phpmyadmin. If you want to ignore multiple error messages then #!/usr/local/bin/perl #unbuffer stdout $|=1; #add the strings to match below separated by | $filter = 'phpmyadmin|setup.php'; while (<STDIN>) { $ErrorMessage=$_; if ( $ErrorMessage !~ m/($filter)/ ) { print $ErrorMessage; } }
For the errorlog there is no built in way to achieve this. You could use log piping to do this by piping the log messages to something that will ignore messages containing some specified string.
Define a pipe to handle the error log
The contents of the httpd_errors script can be as simple as
This waits for messages to arrive on
stdin
and only prints them if they do not contain the stringphpmyadmin
.If you want to ignore multiple error messages then