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.

managing logs

Discussion in 'General Discussion' started by carpman, Nov 1, 2001.

  1. carpman

    carpman Active Member

    Joined:
    Sep 12, 2001
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Hello, i am trying set up my server so i can manange my logs.

    I know that with standard install website logs are rotated at end of month, but i also have some domians setup with logs in home/logs as per:
    http://i4net.tv/marticle/get.php?action=getarticle&articleid=22

    What i would like to do is tar up these logs at the end of each month and clear logs ready for new month.

    Also how do other manange system logs?

    /usr/local/apache/logs/error_log
    /usr/local/apache/logs/access_log
    /var/log/
    /var/spool/exim/input/
    /var/spool/exim/msglog/

    are these rotated? is it possible to get important logs tarred and mailed on regular basis?

    cheers
     
  2. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    9
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    :)

    you can rotate and compress those access logs you moved from my tutorial by adding an entry that looks like this in the /etc/logrotate.d/apache file:

    /home/username/logs/domain.com {
    rotate 5
    daily
    compress
    }

    for each username and domain.com
     
  3. carpman

    carpman Active Member

    Joined:
    Sep 12, 2001
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Thanks will try that.
     
  4. carpman

    carpman Active Member

    Joined:
    Sep 12, 2001
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    One question?
    does this mean that the logs are compressed daily and rotated for 5 months?

    If they are compressed daily how will this affected log programs?

    I have webbalizer set to run at 23.55 each day for logs set using your instrctions.

    Also would a program like webtrends still be able to read compressed files?

    Sorry more then one question?

    I really would like the customised logs to be compressed and cleared just after webbalzir has run at end of month.

    Though i believe that if i have lots of domains using such configuration if may cause problems if they all run at same time each month.

    cheers

    [quote:59e298348c]:)

    you can rotate and compress those access logs you moved from my tutorial by adding an entry that looks like this in the /etc/logrotate.d/apache file:

    /home/username/logs/domain.com {
    rotate 5
    daily
    compress
    }

    for each username and domain.com
    [/quote:59e298348c]
     
  5. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    9
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    [quote:f1b0ae81fb] /home/username/logs/domain.com {
    rotate 5
    daily
    compress
    }
    [/quote:f1b0ae81fb] means logs will rotate daily for 5 days if i understand it :eek:

    you would have logs like

    domain.com
    domain.com.1.gz
    domain.com.2.gz
    domain.com.3.gz
    domain.com.4.gz
    domain.com.5.gz
     
  6. carpman

    carpman Active Member

    Joined:
    Sep 12, 2001
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Ok thanks i can set it for higher if needed.

    I added your suggestion with correct path and name but get this error:

    error: apache:29 bad rotation count\'5 \'
    error: -d option is not supported on Linux
    /usr/sbin/makewhatis: Can\'t create temp file, exiting.

    [Edited on 11/4/01 by carpman]
     
Loading...

Share This Page