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.

Access Logs Ferociously Big

Discussion in 'General Discussion' started by AdamAGB, Dec 22, 2003.

  1. AdamAGB

    AdamAGB Member

    Joined:
    Jul 6, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    My access_log file in /usr/local/apache/domlogs grows to over a gigabyte in only a couple weeks...

    This is mainly due to a few users on the server. I'd like to turn off logging for these few users to benefit everyone else.

    I've done an extensive search through these boards but can't find out how to do this. Can anyone please help?

    Thanks so much,

    -Adam
     
  2. markie

    markie BANNED

    Joined:
    Oct 5, 2003
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    0
    Delete the log then edit the site in question in httpd.conf. Just comment out the line in the users virtual directory that points to domlogs then restart Apache. Finito! No more logs.
     
  3. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Keep in mind that doing this also stops them from getting stats on their site. Better to go into WHM ->Tweak settings and select "Delete each domain's access logs after stats run"
    This will stop the log from growing so big.
     
  4. AdamAGB

    AdamAGB Member

    Joined:
    Jul 6, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I actually commented out that area weeks ago. True, domlogs have disappeared from these users, but the access log file:

    /usr/local/apache/domlogs/access_log

    still grows ridiculously. I also took a look at the access log (which, since deleting it today, has already grown to 40 megs) and it's logging from all the sites I commented out.

    (I commented the line that starts with CustomLog btw)

    I also don't mind these sites not getting statistics, as they coincidentally happen to be the ones I own on the server. And I've always had the appropriate things in Tweak Settings checked and unchecked (delete access logs after stats run checked and keep log files at end of month unchecked).

    Does anyone know how to influence the access_log file directly?

    Thanks,

    -Adam
     
  5. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Which stats must run to reset the domains domlogs? I set this tweak up in whm and was hoping that using the link in AW stats to "update now" would rotate them but no luck. Was hoping to see a fix before the nightly cPanel cron.

    They are still at 1.8 gig (yikes)
     
  6. mahinder

    mahinder Well-Known Member

    Joined:
    Jun 12, 2003
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    matrix
    actually only the files which are large in size say more then 200 mb put load on server. i was wondering if cpanel makes an option through which log files which goes more then 200mb should only be rotated after log files are generated. This will really help all other users on server for whom we want to keep log files for.
     
  7. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Yes in WHM under tweak settings there is an option to clear the logs after stats run, so nighly. I have these checked and it has helped quite a bit.
     
  8. mrcbrown

    mrcbrown Well-Known Member

    Joined:
    Jun 5, 2003
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Try this:

    Code:
    vi /etc/logrotate.d/httpd
    
    INSERT:
    /usr/local/apache/domlogs/*.com {
    rotate 5
    size=40M
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    
    /usr/local/apache/domlogs/*.net {
    rotate 5
    size=40M
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    
    /usr/local/apache/domlogs/*.org {
    rotate 5
    size=40M
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    
    
    That compresses any log over 40 and keeps 5 days worth of compressed old logs. Use the same format if you have any .info .biz etc.
     
  9. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Does this compress the logs every time it reaches the 40M limit?
     
  10. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    According to the original poster, yes anything over 40m.
     
    #10 myusername, May 27, 2004
    Last edited: Jul 27, 2004
  11. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Does not work for me.....
     
    #11 myusername, Jul 8, 2004
    Last edited: Jul 27, 2004
  12. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I have:

    Code:
    
    /usr/local/apache/domlogs/*.net {
    rotate 5
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    
    In /etc/logrotate.d/httpd and I can't get anything to rotate.

    Any thoughts?
     
  13. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    follow instructions!
     
  14. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Do you see any I didnt not follow or are you just trying to increase your worthless post count for the day?
     
  15. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    His code:

    Code:
    /usr/local/apache/domlogs/*.net {
    rotate 5
    size=40M
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    Your code:

    Code:
    /usr/local/apache/domlogs/*.net {
    rotate 5
    daily
    compress
        postrotate
            /usr/local/apache/bin/apachectl graceful
        endscript
    
    }
    Whats different about it?
     
  16. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    I dont know.. I guess im just a sucker for punishment!
     
  17. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Phantom,
    Once again you are showing your worthless self. This has been pointed out many times not only in these boards byt WHT and no doubt others.

    You are not L33t you are a 16 year old idiot who thinks he is a web host.

    Sheldon,

    Yes I do see the difference but size=40M from my understanding is not needed to rotate the logs, it is simply an extra arguement added for the rotation.

    Are you saying this is needed?
     
  18. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    well lets not be a prick about anything ok..

    I dont know.. but he said if it works for him it SHOULD work for you.

    I havent implemented this as I do not have any log problems. My logs all rotate properly and cPanel takes care of everything.

    There must be something more wrong if this doesnt work for you and does for him. Maybe something in the log rotation process itself isnt being executed.

    Id have a deeper look into it.
     
  19. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thanks for your insight on it and I had no intentions of being a prick about anything to you. The phantom on the other side of the coin has this problem with chiming in where no one cares to hear it.
     
Loading...

Share This Page