Rotating Logs - wb6vpm - 02-26-2011 02:55 AM
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.
RE: Rotating Logs - RatS - 02-26-2011 09:23 AM
check the ispcp-logrotation in latest trunk for help.
RE: Rotating Logs - wb6vpm - 03-02-2011 03:26 AM
(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?
RE: Rotating Logs - RatS - 03-02-2011 07:49 AM
http://isp-control.net/ispcp/browser/trunk/configs/debian/logrotate/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.
RE: Rotating Logs - wb6vpm - 03-03-2011 01:44 AM
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
}
RE: Rotating Logs - RatS - 03-03-2011 06:19 AM
User logs will be handled in /var/www/ispcp/engine/traffic/ispcp-vrl-traff
RE: Rotating Logs - wb6vpm - 03-03-2011 06:26 AM
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.
|