StingRay
08-10-2005, 10:57 PM
I have a Cpanel-1 VPS and was reading a post about reducing the load by reducing the amount of logs that apache writes. Can someone comment on the validity of the following.
<VirtualHost *:80>
...
# Logging --
# Filter out everything of no importance to reduce the logging load
# Check the logs periodically to make sure this filter is up-to-date **
<IfModule mod_setenvif.c>
# Filter out what we don't want to log
SetEnvIf Request_URI "\.gif$" no_log
SetEnvIf Request_URI "\.jpg$" no_log
SetEnvIf Request_URI "\.png$" no_log
SetEnvIf Request_URI "\.css$" no_log
SetEnvIf Request_URI "\.js$" no_log
SetEnvIf Request_URI "\.ico$" no_log
SetEnvIf Request_URI "css.php" no_log
SetEnvIf Request_URI "robots.txt" no_log
</IfModule>
# Log what we need for awstats
LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" mylog
CustomLog /var/log/httpd/mysite-access_log mylog env=!no_log
ErrorLog /var/log/httpd/mysite-error_log
...
</VirtualHost>
<VirtualHost *:80>
...
# Logging --
# Filter out everything of no importance to reduce the logging load
# Check the logs periodically to make sure this filter is up-to-date **
<IfModule mod_setenvif.c>
# Filter out what we don't want to log
SetEnvIf Request_URI "\.gif$" no_log
SetEnvIf Request_URI "\.jpg$" no_log
SetEnvIf Request_URI "\.png$" no_log
SetEnvIf Request_URI "\.css$" no_log
SetEnvIf Request_URI "\.js$" no_log
SetEnvIf Request_URI "\.ico$" no_log
SetEnvIf Request_URI "css.php" no_log
SetEnvIf Request_URI "robots.txt" no_log
</IfModule>
# Log what we need for awstats
LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" mylog
CustomLog /var/log/httpd/mysite-access_log mylog env=!no_log
ErrorLog /var/log/httpd/mysite-error_log
...
</VirtualHost>