PDA

View Full Version : Apache optimizing


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>

vps-vince
08-24-2005, 04:26 PM
Interesting.
Can this be done on a domain basis, or it has to be for all doains on my VPS?

Cheers,

- Vince

charles
08-24-2005, 05:25 PM
He's showing it in a virtualhost directive so it can be enabled per domain.

charles

StingRay
08-28-2005, 05:42 PM
Well I tried putting in the .conf file, but not in a VirtualHost directive.
It didn't work.

However I do not want to add it to each virtual host, that would be time consuming. The *:80 note in the .conf says this is for any hosts without a name, so I dont' think that's the answer either.. or is it?