disable logging of images in access log

5 posts / 0 new
Last post
#1 Sun, 04/24/2011 - 09:55
unsalkorkmaz

disable logging of images in access log

Hi,

I dont want to log image,css access in my server.

I found this code:

SetEnvIfNoCase Request_URI "\.(gif|jpe?g|png|htc|css|js|ico)$" skiplog
CustomLog "/var/log/httpd/access.log" combined env=!skiplog

from http://www.linuxweblog.com/blogs/sandip/20101215/disable-logging-images-...

Basically how should i put those in virtualmin? ( Dont want to edit manually if there is a setting option in panel for this)

Sun, 04/24/2011 - 10:00
andreychek

You can do that using the Virtualmin/Webmin GUI by going into Server Configuration -> Configure Website for the Virtual Server you wish to edit, and then click "Edit Directives".

From there, you can add the code you mentioned above.

Note that each Virtual Server already has a "CustomLog" line, so you wouldn't need to add a second one or you may start seeing some unexpected results :-)

-Eric

Sun, 04/24/2011 - 10:10
unsalkorkmaz

Thanks. So it will just effect to that virtual server.. is there any other way/chance to put that code as global? or need to edit all virtual servers?

Mon, 04/25/2011 - 12:01
andreychek

I believe you would need to edit each Virtual Server... I don't believe settings such as that would be inherited within each VirtualHost block.

-Eric

Mon, 04/25/2011 - 13:11
unsalkorkmaz

Yes it seems, btw for future people looking same solution,I used this sample:

http://2bits.com/drupal-performance/reducing-size-and-io-load-apaches-we...

Topic locked