The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable logging for specific folder on specific domain

Discussion in 'EasyApache' started by morrow95, Jun 27, 2017.

  1. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    104
    Likes Received:
    2
    Trophy Points:
    168
    I have a bunch of php scripts in a specific folder on one of my domains which are constantly accessed (20+ hits a second) and would like to disable access logging for all of them (the folder). I am using CentOS 6 with Apache 2.4.

    I found information on how to do this using environment variables and modifying the host file (Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation), but I am not sure how to customize this for my needs.

    I want to disable logging for /home/username/public_html/folder1/ (everything in it).

    **EDIT**

    I accomplished this with :

    <IfModule mod_userdir.c>
    SetEnvIf Request_URI "^/folder1/" dontlog
    CustomLog /usr/local/apache/domlogs/domain.com combined env=!dontlog
    </IfModule>

    'username' and 'domain.com' represent their actual values in the above.
     
    #1 morrow95, Jun 27, 2017
    Last edited: Jun 28, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm glad to see you were able to get it working. Thank you for updating us with the solution you used.
     
Loading...

Share This Page