disable logging of images in access log


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-access-log

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

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 :slight_smile:


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?

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.


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