Archive for the ‘Logs’ category

Manually Rotate Logs with logrotate

September 8th, 2010

The individual configuration files for logrotate are located in /etc/logrotate.d:

# cd /etc/logrotate.d/

Then, to manually rotate the logs for exim, simply run the following.

# logrotate exim

Note: you won’t see any output, but you will notice that the exim logs in /var/log are now rotated out.

Share

cPanel Log Locations

July 29th, 2010

cPanel Log File Locations

This is a shortlist of various log files for various applications on your Cpanel VPS.

cPanel Installation Logs:
/var/log/cpanel-install-thread0.log

Apache:
/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log

Apache domlogs:
/usr/local/apache/domlogs/example.com

Apache SUEXEC Logs:
/usr/local/apache/logs/suexec_log

MySQL
/var/lib/mysql/hostname.err

BIND (named) Log:
/var/log/messages

Exim
/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Courier or Dovecot IMAP
/var/log/maillog

Tomcat Logs:
/usr/local/jakarta/tomcat/logs/catalina.err
/usr/local/jakarta/tomcat/logs/catalina.out

cPanel Access Log:
/usr/local/cpanel/logs/access_log

cPanel Error Log:
/usr/local/cpanel/logs/error_log

cPanel License Log:
/usr/local/cpanel/logs/license_log

Stats Execution Logs:
/usr/local/cpanel/logs/stats_log

ChkServd (cPanel Monitoring Daemon) Logs:
/var/log/chkservd.log

cPHulkd
/usr/local/cpanel/logs/cphulkd.log

cPanel Backup Logs:
/usr/local/cpanel/logs/cpbackup/*.log

Pure-FTP
/var/log/messages
/var/log/xferlog (symlinked to /usr/local/apache/domlogs/ftpxferlog)

Cron Logs:
/var/log/cron

SSH Logs:
/var/log/secure

ModSecurity:
/usr/local/apache/logs/modsec_audit.log
/usr/local/apache/logs/modsec_debug_log

Share

How to Install Logwatch

October 31st, 2009

Logwatch is very simple to install on CentOS boxen:

yum -y install logwatch

This will install logwatch and configure the daily logwatch cron in /etc/cron.daily. If you want to customize your logwatch configuration, you can edit /etc/logwatch/conf/logwatch.conf and modify settings like the email address the report is sent to, the verbosity of the report, what day you want logwatch to process, etc. A sample configuration is located at /usr/share/logwatch/default.conf/logwatch.conf

Share

Enable Logging of Slow MySQL Queries

October 10th, 2009

MySQL has a feature that allows you to log slow running queries to a file. To enable you just need to add some lines to your my.cnf file, and restart.

Insert the following into /etc/my.cnf:

log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 5

Save my.cnf and do the following when you return to a shell:

#touch /var/log/mysql/mysql-slow.log
#chown mysql:mysql /var/log/mysql/mysql-slow.log
#service mysql restart

Share

Webmail logins failing

October 1st, 2009

First thing — check /usr/local/cpanel/logs/login_log

If you see a line like:

208.74.121.102 - name@domain.com [10/01/2009:17:21:12 -0000] "POST
/login/ HTTP/1.1" FAILED LOGIN webmaild: user password hash is missing
from system (user probably does not exist)

Check /home/USER/etc/DOMAIN/shadow to make sure that the webmail user is listed there. If not, copy one of the lines, change the username, and reset the password via cPanel.

Share

cPanel Web Site Hosting by IntraHost