|
|
Disable logging of gifs/jpgs from webserver
Below shows how to remove gifs/jpgs from being logged by the webserver. This will reduce the log size being stored on the filesystem.
Note: Modify the parameters to suit your environment.
- Goto the directory in which your webserver configurations reside. For the purpose of this document, we will assume the webserver is installed within "/usr/local/apache"
cd /usr/local/apache/conf
- Backup the current configurations
mkdir backup-`date`
cp * backup-`date`
- Modify the httpd.conf by adding the below lines. The below statements instruct the webserver to declare an environment variable "gif-image" that will look at the URI for ".gif" and ".jpg".
SetEnvIf Request_URI \.gif$ gif-image
SetEnvIf Request_URI \.jpg$ gif-image
To remove other images/files from being logged, add another statement as above except change the file extension.
- Modify the "CustomLog" parameter or whichever logging statement being used today, to utilize the new logging format.
- Old Log Format
CustomLog /logs/https/wzc_www/access combined
- New Log Format
CustomLog /logs/https/wzc_www/access combined env=!gif-image
The "env=!gif-image" appended to the "CustomLog" parameter instructs the webserver not to log any files which defined within the "gif-image" environment variable.
- Restart the webserver in order for the new parameters to take effect.
/usr/local/apache/bin/apachectl restart
- Once the webserver has been restarted the webserver logs will no longer have any entries refering to ".gif" and ".jpg".
|
|
|