Tuesday, 2 December 2014

Enable MySQL slow query log

The slow query log consists of SQL statements that took more than long_query_time seconds to execute and required at least min_examined_row_limit rows to be examined. It is very helpful in troubleshooting bad queries.
Add the following to /etc/my.cnf file to enable the slow query log:
Code: [Select]
log-slow-queries=/var/lib/mysql/slow.log
After that, then do the following commands to create the file with the right ownership and file permissions:
Code: [Select]
touch /var/lib/mysql/slow.log
Code: [Select]
chmod 660 /var/lib/mysql/slow.log
Code: [Select]
chown mysql:mysql /var/lib/mysql/slow.log

Php page showing a warning message: phpinfo() has been disabled

If you get the message while browsing php info page, it means that phpinfo function is disabled. To resolve this you will have to :
Remove phpinfo from disable_functions in php.ini
To locate php.ini file, use command :
Code: [Select]
# php --ini
Check the line Loaded Configuration File: for php.ini location. Remove phpinfo  from disable_functions in php.ini and save it.
Now check the phpinfo page

Softaculous – The INFO.XML file could not be found!

This happens if the scripts are not downloaded. The fix is to run CRON :
SSH to your server as root and enter following commands:
For cPanel:
# /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cron.php
For Direct Admin:
#  /usr/local/bin/php -d open_basedir=/ -d safe_mode=0 -d disable_functions=”" /usr/local/directadmin/plugins/softaculous/cron.php
For Plesk:
SSH to your server as root and enter following command :
# php /usr/local/softaculous/cron.php

Whitelist an IP from IPTABLES

To check if an IP is blocked in iptables, use the command :
Code: [Select]
# iptables -nL | grep IP
Sample output :
DROP       all  –    x.x.x.x    0.0.0.0/0
If the IP is blocked in iptables, to see the rule :
Code: [Select]
iptables-save|grep IP
Sample output :
-A LOCALINPUT -s x.x.x.x -i eth0 -j DROP
Take the results and replace “-A” with “-D” and run it with iptables
Eg : iptables -D LOCALINPUT -s x.x.x.x -i eth0 -j DROP

Round cube Mail issue with out an header.

 login WHM>> cPanel >> check the quota>>it should be full

Please increase the quota size.

WHM + cPanel login failed to open session lockfile: FILE=/var/cpanel/sessions/raw==== Disk quota exceeded at /usr/local/cpanel/Cpanel/Session.pm line 238

Error:

failed to open session lockfile: FILE=/var/cpanel/sessions/raw/:vcLgdleh6y8pqVchZOpxJ85a133IKpf7UsU4FrhLW0tFJmVEC7jHZJ90ZtBUKNIZ.lock, Disk quota exceeded at /usr/local/cpanel/Cpanel/Session.pm line 238

====

Check the disk size
=======
# df-Th
you  could see the disc is 100%

Please delete some unwanted files and try login

Fine. 

Nginx Page not found -- 500-

View nginx error log
/var/log/nginx/nginx_error.log

If the service is temporarily stopped Please restart the same .