Skip to main content

Posts

Get cPanel certification from university.cpanel.net

Troubleshooting high server cpu LOAD and Memory usage

Here we can go throw , how server CPU loads can be troubleshooted. Figure out the root cause and solution ======================================================================== Sometime you may need to find out load in the VZ node where you have cPanel VPS Issue the below command to spot which VM is the culprit vzlist -o laverage,veid,hostname   check the result and log in to the VM vzctl enter VMID ======================================================================== Finding Load causing connections and users ============================== By default dcpumon runs every 5 min to log CPU usage ("top" output) and stores the data into /var/log/dcpumon # crontab -l | fgrep cpu */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1 # You can view the report with "dcpumonview" command: root@cpanel [~]# /usr/local/cpanel/bin/dcpumonview ----------------------------------------------------------- |User    |D...

SPAMMING 2

Now we can run the following command to see what scripts are located in that directory: ls -lahtr /userna5/public_html/data drwxr-xr-x 17 userna5 userna5 4.0K Jan 20 10:25 ../ -rw-r--r-- 1 userna5 userna5 5.6K Jan 20 11:27 mailer.php drwxr-xr-x 2 userna5 userna5 4.0K Jan 20 11:27 ./ grep "mailer.php" /home/userna5/access-logs/example.com | awk '{print $1}' | sort -n | uniq -c | sort -n Deny those IP ======================================================================== Locate email accounts being used to spam grep "A=courier_login" /var/log/exim_mainlog | sed -e 's#H=.* \[##' -e 's#\]:[0-9]*##' | awk '{print $5,$6}' | sort | uniq | awk '{print $1}' | uniq -c | awk '{ if ($1 > 1) print $0}' grep "A=courier_login" /var/log/exim_mainlog | sed -e 's#H=.* \[##' -e 's#\]:[0-9]*##' | awk '{print $5,$6}' | sort | uniq -c You can switch the mail se...

SPAMMING 1

1) pidof exim 2) Below command will show you the no of emails sent by particular domain: exim -bp | exiqsumm | more 3) exim -bpr | grep “<*@*>” | awk “{print $4}”|grep -v “<>” | sort | uniq -c | sort -n | less This will show you the maximum no of email currently in the mail queue have from or to the email address in the mail queue with exact figure. 4) exim -bpr | grep “<*@*>” | awk “{print $4}”|grep -v “<>” |awk -F “@” “{ print $2}” | sort | uniq -c | sort -n | less That will show you the maximum no of email currently in the mail queue have for the domain or from the domain with number. 5) Find the script which is sending the mass mails :- cd /var/spool/exim/input egrep “X-PHP-Script” * -R You can see the script there, if not seeing there just read the mail id file with your favorite test editor exim -bpr | grep “<*@*>” | awk ‘{print $4}’|grep -v “<>” |awk -F “@” ‘{ print $2}’ | sort | uniq -c | sort -n These list the current worki...

Some basic MySQL commands for system administrators

# HOW TO CREATE A USER IN MYSQL mysql> CREATE USER 'wordpress_user'@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec) # CREATE A DATABASE mysql> CREATE DATABASE LINUXAVID; Query OK, 1 row affected (0.00 sec) # DROP/DELETE A DATABASE mysql> drop database LINUXAVID; Query OK, 0 rows affected (0.00 sec) #CHECK THE PROCESS LIST root@cpanel [~]# mysqladmin proc +-------+-----------+-----------+-----------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-------+-----------+-----------+-----------+---------+------+-------+------------------+ | 46457 | eximstats | localhost | eximstats | Sleep | 8564 | | | | 47181 | root | localhost | | Query | 0 | | show processlist | +-------+-----------+-----------+-----------+---------+------+-------+------------------+ #CHECK PROCESS LIST ...

mysqladmin command and mysqlshow command usage and examples

mysqladmin command 1)Change MySQL root password mysqladmin -u root -ptmppassword password 'newpassword' 2) Check MySQL server is up or not mysqladmin -u root -p ping 3) Find MySQL server version mysqladmin -u root -ptmppassword version 4) Show the current MySQL servers status mysqladmin -u root -ptmppassword status 5) Find the values of status variables mysqladmin -u root -ptmppassword extended-status 6) Find the values of MySQL system variables mysqladmin -u root -ptmppassword variables 7) Show all the running process/queries in MySQL databases mysqladmin -u root -ptmppassword processlist 8) Create MySQL database mysqladmin -u root -ptmppassword create testdb 9) Delete database mysqladmin -u root -ptmppassword drop testdb 10) Shutdown the MySQL server mysqladmin -u root -ptmppassword shutdown 11) Kill MySQL client process mysqladmin -u root -ptmppassword kill 20 (20 is the process id with the process list) mysqlshow command 1) Show all the da...