Friday, 20 June 2014

/Var issues check :

ls -lh /var/log/* >> check for the log files which is consuming high size


 ls -hrSal /var/spool/mail/*  >> Check for the account usernames which is consuming high size (above 50 MB) then,

tail -2000 /var/spool/mail/username


ls -lh /var/spool/mqueue/*  >> check the recent email headers using the command :

tail -2000 /var/spool/mqueue/id
Semaphores

# ipcs -s
If you see a list of semaphores, Apache has not cleaned up after itself, and some semaphores are stuck. Clear them out with this command:

 for i in `ipcs -s | awk '/httpd/ {print $2}'`; do (ipcrm -s $i); done
Command to check the most recent resources usage in cpanel servers

/usr/local/cpanel/bin/dcpumonview

Log location : /var/log/dcpumon/
Command to get recent reboot logs

 grep -A 10 -B 30 syslogd /var/log/messages

Command to check memory usage in windows server

tasklist /fi "memusage gt 90000" | sort /R /+58

Sunday, 9 February 2014

Clam Scan Manual Installation


cd /usr/local/src
rm -Rf clamav-*
wget http://downloads.sourceforge.net/clamav/clamav-0.96.tar.gz
tar -xzf clamav-*
cd clamav-*
if [ -d "/usr/lib64" ]; then libdir=”–libdir=/usr/lib64″ ; fi ; ./configure –prefix=/usr $libdir –sysconfdir=/etc –disable-ipv6 –disable-zlib-  vcheck
make
make install
freshclam
echo “ClamAV update complete!”



Reset Mysql Root password 


Recover a MySQL root password via the folowing steps :

Stop the MySQL server process :

/etc/init.d/mysql stop

Start again with no grant tables.

mysqld_safe --skip-grant-tables &

Login to MySQL as root.

mysql -u root
use mysql;

Set new password.

update user set password=PASSWORD("newrootpassword") where User='root';
flush privileges;
quit

Exit MySQL and restart MySQL server.

/etc/init.d/mysql stop
/etc/init.d/mysql start