Türkce » WHM cPanel

Fix Log Rotation Problems in cPanel

http://forum.whmdestek.com/

Go Back   WHM/cPanel Support Platform » Türkce » WHM cPanel
 

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10.11.07, 19:59
CaLViN's Avatar
Sevgi güctür.
 
Join Date: Apr 2007
Location: Outta nation
Age: 28
Posts: 2,083
Rep Power: 100000
CaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond reputeCaLViN has a reputation beyond repute
Fix Log Rotation Problems in cPanel

Since the beginning of time, cPanel has had logs that it simply does not rotate properly. Why this has been an ongoing problem that has never been fixed is beyond me, but it CAN be fixed and we'll go through what is needed to accomplish this.
The most important logs that are missed are the Apache system logs that are located in /usr/local/apache/logs. SSH into your server as root.


pico /etc/logrotate.d/httpd

(on some servers this file is called apache)


The first line should read:

/usr/local/apache/logs/*log {


Also you need to change the line that reads:

/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true


to:

/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
(the above line should all be on ONE LINE!)


The next log file that needs to be dealt with is /var/log/xferlog. This is your FTP transfer log.

pico /etc/logrotate.d/ftp


This will create a new file. If you are running ProFTP, paste the following snippet into this file:

/var/log/xferlog {
postrotate /bin/kill -HUP `cat /var/proftpd.pid 2> /dev/null` 2> /dev/null || true
endscript
missingok
}



If you are running PureFTP then paste this into the file:

/var/log/xferlog {
postrotate /bin/kill -HUP `cat /var/run/pure-ftpd.pid 2> /dev/null` 2> /dev/null || true
endscript
missingok
}



The next item we need to deal with is for any sites for which you have installed SSL certificates for. If you have not installed any SSL certificates, then you can skip this section. Any domain that you have installed an SSL certificate for gets a log file for

tracking SSL traffic and it is located in /var/log. These are pretty simple to add.

pico /etc/logrotate.conf


Add an entry styled like the one below for each secure domain you have on your server at the end of the file:

/var/log/securedomain.tld {
weekly
rotate 1
}



Take a look in /var/log to make sure that you have the proper filename i that first line. It will match exactly as you have it set up in WHM.
One other stray log that cPanel ignores is /var/log/chkservd.log. Add this section to the same file (/etc/logrotate.conf) that you were just editing:

/var/log/chkservd.log {
weekly
rotate 1
}



To add insult to injury, cPanel is not rotating its own logs either. Place this in the same file we have been editing:

/usr/local/cpanel/logs/stats_log {
weekly
rotate 1
}

/usr/local/cpanel/logs/access_log {
weekly
rotate 1
}

/usr/local/cpanel/logs/error_log {
weekly
rotate 1
}


Thanks to S. Leggett
__________________
1.)Lütfen destek talebinde bulunmak icin özel mesaj ile iletisime gecmeyiniz.
2.)Ücretsiz destek almak icin forum sayfalarimizi kullanmaniz ayni sorunu yasayan diger üyelerin cevaplara en kisa sürede ulasabilmesi ve sizlere yardimci olmak isteyen bizlerin ve diger üyelerimizin zaman kazanmalari acisindan cok önemlidir.
3.)Forumlarimizda sorunlarinizi anlatirken mümkün oldugunca cok detay vermeniz en kisa sürede sorununuza cözüm bulmaniz acisindan mühimdir.

Daha cok ögrenmek ve ögretmek dilegiyle..
Sevgiler..
The Platform.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 06.03.09, 09:42
Atari
 
Join Date: Mar 2009
Posts: 8
Rep Power: 0
nizzy is on a distinguished road
rotation time for each domain

In my server, each domain has its own log rotation time for awstats.

How can I change the rotation time to 24:00 for all?

thank you

Last edited by nizzy; 06.03.09 at 10:04.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




netinternet

Navigasyon
Menü