Tuesday, March 17, 2015

Disable cphulked

1)Get the console
2)connect to mysql and execute following commands-

3)
#mysql

mysql> connect cphulkd

mysql> delete from brutes;
Query OK, 0 rows affected (0.00 sec)

mysql> delete from logins;
Query OK, 32 rows affected (0.00 sec)


4)After that you can disable cphulked with following command.

#/usr/local/cpanel/etc/init/stopcphulkd

Wednesday, February 18, 2015

exim port check

While checking the exim logs if you are getting "timeout" error then you should check the port  as below -

1) IN to OUT port check-

[root@ns1 ~]# telnet mail.xxx.com 25
Trying 1.2.3.4...
Connected to mail.xxx.com.//you will get time-out here
Escape character is '^]'.
220 host.xxx.net ESMTP Postfix

2)Out to IN port check
check with url http://ping.eu

3)Make sure the ports 25,465,587,110 are open for server x.x.x.x on both side. 

check mysql processes in plesk

check mysql processes in plesk
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e 'show processlist' 

find and delete script command

1)find /home/username/mail/new -name "123*" -exec rm -fv {} \;

Replace the "123*" entry with a prefix of what your files within this directory start with. This is a safeguard so you do not use the command incorrectly and delete files you are not supposed to. Ensure you are careful with the directory that you enter in this command because we do not generally recommend mass deletion of files.


2)find  ~/user/images/* -maxdepth 1 -type f | wc -l  
It will show you the count of images present under specified folder.

3)find /newdata/active_images/images -type f -iname "*.jpg"
output =>
/newdata/active_images/images/9780548358559.JPG
/newdata/active_images/images/9781240551071.jpg
/newdata/active_images/images/9781286130742.jpg

3) root@host [/newdata/active_images]# cat rm.php
// Specify the target directory and add forward slash
$path = "images/";
// Loop over all of the files in the folder
foreach(glob($path ."*") as $file) {
    unlink($file); // Delete each file through the loop
}
?>

=> This script delete all files present under image folder.

Exim commands

# List all queued messages, grouped by sender address
exim -bpr | grep -Eo "<[^ ]*@[^ ]*>" | sort | uniq -c

# List all queued messages, grouped by recipient address
exim -bpr | grep -Eo "^\s*[^ ]*@[^ ]*$" | sort | uniq -c

# Remove all messages older than 12hrs (43000 seconds)
exiqgrep -o 43000 -i | xargs exim -Mrm

# Remove all frozen messages from the queue
exiqgrep -z -i | xargs exim -Mrm

# Remove all messages from a particular sender
exiqgrep -i -f [user]@domain.com | xargs exim -Mrm

# Remove all messages from a sender that are older than 12hrs
exiqgrep -o 43000 -i -f [user]@domain.com | xargs exim -Mrm

cpanel required ports

If your server is having cpanel , you should open following ports in firewall
---
20,21,25,26,43,53,80,110,143,443,465,873,993,995,2083,2082,2086,2087,2095,2096,3306,2089
--

not able to sent mail

Not able to send mails to particular email id only x@xxx.com  and getting following logs -

2015-02-17 15:23:39 [3230] 1YNeqU-0000q1-No ** x@xxx.com F= P= R=dkim_lookuphost T=dkim_remote_smtp: SMTP error from remote mail server after initial connection: host x1x.xxx.com [192.8.186.129]: 554 x1x.xxx.com

Solution -
1)check hostname file.
2)Make sure that you have setup RDNS for the MX record.

Recursive chmod

Recursive chmod within folder:

For suphp you should have 644 permissions to all file and 755 permission for directories.
If not then you can modify it with below commands -
--------------------------------------------
find . -type f -exec chmod 0644 {} \;

find . -type d -exec chmod 0755 {} \;
--------------------------------------------