Add to Favourites Add to Favourites    Print this Article Print this Article

Prevent apache logging of certain requests

If you have a common request that might be filling up your logs or you simply don't wish to see it (knowing it may skew your web stats), then you can tell Apache not to log it by doing:
  1. Create

    /etc/httpd/conf/extra/dontlog.conf

    and add the code

    CustomLog /var/log/httpd/domains/directadmin.com.log combined env=!dontlog

  2. In your /etc/httpd/conf/extra/httpd-includes.conf, add this code:

    Include /etc/httpd/conf/extra/dontlog.conf

  3. Lastly, for any site where you wish to disable the request of a given file, let's call it:

    You could go to:

    Admin Level -> Custom Httpd Config -> domain.com

    and in the top CUSTOM textarea, add:

    SetEnvIf Request_URI "^/commonfile.txt" dontlog
    |?COMBINED_LOG=combined env=!dontlog|

This uses the following DA feature:
http://www.directadmin.com/features.php?id=1712


Was this answer helpful?

Also Read