Archive for the ‘Logs’ category

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

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
#touch /var/log/mysql/mysql-slow.log
#chown mysql:mysql /var/log/mysql/mysql-slow.log
#service mysql restart

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.