Prevent apache logging of certain requests


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information

Prevent apache logging of certain requestsLast Modified: Jan 3, 2016, 10:40 am
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

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST