Current time: 11-29-2024, 12:10 PM Hello There, Guest! (LoginRegister)


Post Reply 
Rotating Logs
Author Message
wb6vpm Offline
Junior Member
*

Posts: 80
Joined: Oct 2007
Reputation: 0
Post: #1
Rotating Logs
i have searched to no avail, but is there a way to rotate the logs, so that they dont get out of hand (one of my hosts has a 15Gb access log!)

i have:

ispCP 1.0rc2 OMEGA
build: 2007-04-18
Priamos

upgrading is not an option.
02-26-2011 02:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #2
RE: Rotating Logs
check the ispcp-logrotation in latest trunk for help.
02-26-2011 09:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
wb6vpm Offline
Junior Member
*

Posts: 80
Joined: Oct 2007
Reputation: 0
Post: #3
RE: Rotating Logs
(02-26-2011 09:23 AM)RatS Wrote:  check the ispcp-logrotation in latest trunk for help.

thanks for that, does this apply to my version, or do i have to upgrade to use this?
(02-26-2011 09:23 AM)RatS Wrote:  check the ispcp-logrotation in latest trunk for help.

also, maybe i am blind, but i tried looking through the documentation, but I dont see anything regarding it? Did i miss something?
(This post was last modified: 03-02-2011 03:35 AM by wb6vpm.)
03-02-2011 03:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #4
RE: Rotating Logs
http://isp-control.net/ispcp/browser/tru...tate/ispcp

Just copy the first 4 rotation sections to your /etc/logrotate.d/ispcp. Next time the rotation will be triggered your files are getting rotated.
03-02-2011 07:49 AM
Visit this user's website Find all posts by this user Quote this message in a reply
wb6vpm Offline
Junior Member
*

Posts: 80
Joined: Oct 2007
Reputation: 0
Post: #5
RE: Rotating Logs
sorry, not to do the 20 question thing, but does this also deal with the domain logs (ie /var/www/virtual/{domain_name}/logs/ directory?) as these are the main ones that are causing me my headaches.

i do appreciate all your help with this.
here is what my /etc/logrotate.d/ispcp has currently:
Code:
/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

ok, i think i have it figured out (assuming as asked above that this does what I was looking for):
Code:
/var/log/apache2/users/*.log {
  weekly
  missingok
  rotate 52
  compress
  delaycompress
  notifempty
  create 640 root adm
  sharedscripts
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff >/var/log/ispcp/ispcp-vrl-traff.log 2>&1
  endscript
  postrotate
    if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
      /etc/init.d/apache2 reload > /dev/null
    fi
  endscript
}

# Rotation for user traffic prevs
#
/var/log/apache2/backup/*.log.prev {
  size 5M
  missingok
  rotate 5
  compress
  delaycompress
  notifempty
  create 640 root adm
}

# Rotation for apache2, launching general statistics if awstats is installed
#
/var/log/apache2/*.log {
  weekly
  rotate 52
  missingok
  compress
  delaycompress
  notifempty
  create 640 root adm
  sharedscripts
  prerotate
        if [ `cat /etc/ispcp/ispcp.conf | grep -c 'AWSTATS_ACTIVE *= *yes'` = 1 ]; then
      perl /var/www/ispcp/engine/awstats/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl >/dev/null 2>&1
    fi
  endscript
  postrotate
    if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
      /etc/init.d/apache2 reload > /dev/null
    fi
  endscript
}

# Rotation for ispcp-apache-logger logfiles
#
"/var/log/ispcp/ispcp-apache-logger.stderr" /var/log/ispcp/ispcp-apache-logger.stdout {
  weekly
  rotate 2
  size 10M
  missingok
  compress
  delaycompress
  notifempty
  create 640 root adm
}

/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}
(This post was last modified: 03-03-2011 02:01 AM by wb6vpm.)
03-03-2011 01:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #6
RE: Rotating Logs
User logs will be handled in /var/www/ispcp/engine/traffic/ispcp-vrl-traff
03-03-2011 06:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
wb6vpm Offline
Junior Member
*

Posts: 80
Joined: Oct 2007
Reputation: 0
Post: #7
RE: Rotating Logs
ok, so what about the ones that get generated inside of /var/www/virtual/{domain_name}/logs/

or is /var/www/ispcp/engine/traffic/ispcp-vrl-traff where they are really located?

becuase the files i am having hte size issue with are the ones at /var/www/virtual/{domain_name}/logs/

sorry for the redundant questions.
03-03-2011 06:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)