Sunday, December 22, 2013

Mysql slow query logs : /var/log/mysql-slow.log

The slow query log consists of SQL statements that took more than long_query_time seconds to execute. The minimum and default values of long_query_time are 1 and 10, respectively.
The time to acquire the initial table locks is not counted as execution time. mysqld writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might differ from execution order.
To enable the slow query log, start mysqld with the --log-slow-queries[=file_name] option.
If the slow query log file is enabled but no name is specified, the default name is host_name-slow.log and the server creates the file in the same directory where it creates the PID file. If a name is given, the server creates the file in the data directory unless an absolute path name is given to specify a different directory.

Warning: phpinfo() has been disabled for security reasons in

goto php.ini >> disable_functions

Monday, December 16, 2013

Server details script : Version information

#!/bin/bash
echo "==========================" >> serverdetails
ccpanel=`/usr/local/cpanel/cpanel -V`
echo "cPanel Version" ":" "$ccpanel" >> serverdetails
A1=`/usr/local/apache/bin/httpd -v | sed -n 1p | awk '{print $3}'`
echo "Apache Version"  ":" "$A1" >> serverdetails
P1=`php -v | sed -n 1p | awk '{print $2}'`
echo "PHP Version" ":" "$P1" >> serverdetails
C1=`csf -v | awk '{print $2}'`
echo "CSF Version"  ":"  "$C1" >> serverdetails
M1=`mysql -e status | grep 'Server version' | awk {'print $3'}`
echo "MySql Version" ":" "$M1" >> serverdetails
K1=`uname -a | awk {'print $3'}`
echo "Kernel Version"  ":" "$K1"  >> serverdetails
A2=`cat /usr/local/apache/conf/httpd.conf | grep "ServerSignature"`
echo "Apache Server Signature" ":" "$A2" >> serverdetails
W1=`stat /usr/bin/wget | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Wget" ":" "$W1">> serverdetails
F1=`stat /usr/bin/find | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Find"  ":" "$F1" >> serverdetails
L1=`stat /usr/bin/locate | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Locate" ":" "$L1" >> serverdetails
L2=`stat /bin/link | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Link" ":"  "$L2" >> serverdetails
L3=`stat /usr/bin/lynx | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Lynx" ":" "$L3" >> serverdetails
R1=`cat /var/cpanel/cpanel.config | grep alwaysredirecttossl`
echo "$R1" >> serverdetails
A3=`cat /var/cpanel/cpanel.config | grep allow_login_autocomplete`
echo "$A3"  >> serverdetails
S1=`cat /var/cpanel/cpanel.config | grep create_account_spf=0`
echo "$S1"  >> serverdetails
M3=`cat /var/cpanel/cpanel.config | grep  defaultmailaction=fail`
echo "$M3" >> serverdetails