How to list all cron entries on a WHM/cPanel based servers
Here is the small piece of code that helps
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
And Cpanel Crontab Location
/var/spool/cron/
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
/var/spool/cron/
/usr/sbin/exim -bt -d email@address.comRetry message delivery:
/usr/sbin/exim -M messageIDForce delivery of all message:
/usr/sbin/exim -qfForce delivery of all message and delete of frozen ones:
/usr/sbin/exim -qffShows log delivery for a message:
/usr/sbin/exim -Mvl messageIDDisplay message body:
/usr/sbin/exim -Mvb messageIDDisplay message header:
/usr/sbin/exim -Mvh messageIDDelete a message without warning:
/usr/sbin/exim -Mrm messageIDCount messages in queue:
/usr/sbin/exim -bpr | grep "<" | wc -l or /usr/sbin/exim -bpcDisplay all messages from queue:
/usr/sbin/exim -bpCount frozen messages:
/usr/sbin/exim -bpr | grep frozen | wc -lDelete frozen messages:
/usr/sbin/exim -bpr | grep frozen | awk '{print $3}' | xargs /usr/sbin/exim -Mrm
chmod 0 /home/username/etcYou need to replace username with your user username. Once this is done the user will not be able to send anymore emails from local server. To undo this you should run the chattr once more:
chattr +ia /home/username/etc
chattr -ia /home/username/etc
chmod 750 /home/username/etc
Replace $USER with the actual cPanel account username (the cPanel user, not the domain).# /scripts/generate_maildirsize --confirm --allaccounts --verbose $USER
service network restart
command will remove the IPv6 addresses from the network device. To restart your IPv6 configuration, you must run the /etc/init.d/cpipv6 restart
command after you restart the network service.exim mail transfer agent (mta). | /usr/local/cpanel/scripts/restartsrv exim |
bind nameserver daemon. | /usr/local/cpanel/scripts/restartsrv named |
proftp ftp server daemon. | /usr/local/cpanel/scripts/restartsrv proftpd |
pure-ftp ftp server daemon. | /usr/local/cpanel/scripts/restartsrv pureftpd |
apache web server daemon. | /usr/local/cpanel/scripts/restartsrv httpd |
courier mail server daemon. | /usr/local/cpanel/scripts/restartsrv courier |
dovecot mail server daemon. | /usr/local/cpanel/scripts/restartsrv dovecot |
system logs daemon. | /usr/local/cpanel/scripts/restartsrv syslogd |
clam antivirus software daemon. | /usr/local/cpanel/scripts/restartsrv clamd |
secure shell (ssh) daemon | /usr/local/cpanel/scripts/restartsrv sshd |
common unix superserver daemon responsible for managing internet services. | /usr/local/cpanel/scripts/restartsrv inetd |
cpanel’s version of pop3 mail downloading service. similar to imap. | /usr/local/cpanel/scripts/restartsrv cppop |
imap mail downloading service. similar to pop3. | /usr/local/cpanel/scripts/restartsrv imapd |
mysql database server. | /usr/local/cpanel/scripts/restartsrv mysql |
postgresql database server. | /usr/local/cpanel/scripts/restartsrv postgresql |
interchange e-commerce server. | /usr/local/cpanel/scripts/restartsrv interchange |
java servlet container and http server. | /usr/local/cpanel/scripts/restartsrv tomcat |
chat service. | /usr/local/cpanel/scripts/restartsrv entropychat |
/etc/init.d/
directory.service (daemon) name | error log location | notes |
apache web server (httpd) | /usr/local/apache/logs/error_log | details errors encountered during apache requests. |
bind nameserver (named) | /var/log/messages | |
proftp server (proftpd) | /var/log/messages | |
pure-ftp server (pureftpd) | /var/log/messages | |
exim mail transfer agent (exim) | /var/log/exim_mainlog | details all exim transactions. |
exim mail transfer agent (exim) | /var/log/exim_rejectlog | details rejected messages and reasons. |
exim mail transfer agent (exim) | /var/log/exim_paniclog | details configuration and similar errors. |
courier pop3/imap service (imapd) | /var/log/maillog | |
dovecot pop3/imap service (imapd) | /var/log/maillog | |
mysql database server (mysqld) | /var/lib/mysql/hostname.err | substitute hostname with your server's hostname. |
(in freebsd: /var/db/mysql/hostname.err ) | ||
openssh secure shell service (sshd) | /var/log/messages, | log location depends on the configuration of the syslog service. |
/var/log/secure, or | ||
/var/log/auth |
/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log
/usr/local/apache/domlogs
/var/log/exim_mainlog
/var/log/exim_rejectlog
/usr/local/cpanel/logs/access_log
/usr/local/cpanel/logs/error_log
/var/log/messages
1 > Create a .htaccess file under the directory : /home/username/public_html
root@server[#] cd /home/username/public_html
root@server[/home/username/public_html]# vi .htaccess
And the below two lines at the top :
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
save and quit.
2 > go to the cgi-bin directory : /home/username/public_html/cgi-bin
root@server[#] cd /home/username/public-html/cgi-bin
and then copy the default php.ini here
root@server[#] cp /usr/local/lib/php.ini /home/username/public_html/cgi-bin/
3 > Create php.fcgi file to load custom php.ini
Please note that you should still be in /home/username/public_html/cgi-bin location.
root@server[/home/username/public_html/cgi-bin] # vi php.fcgi
and then add the below code :
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
save and quit.
Now make the file php.cgi executable:
root@server[/home/username/public_html/cgi-bin] # chmod + x php.fcgi
4 > Change ownership of files to correct user:And if it still does not work for you then follow the below steps as well :
root@server[/home/username/public_html/cgi-bin] chown username.username * -R
5 > Add paths to php.conf file
root@server[#] vi /usr/local/apache/conf/php.conf
and add the below lines :
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php
save and quit.
and after adding the above two lines the php.conf file should look like this :
root@server[/usr/local/apache/conf] # cat php.conf
# Fastcgi configuration for PHP5
LoadModule fcgid_module modules/mod_fcgid.so
MaxRequestsPerProcess 500
AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
# End of autogenerated PHP configuration.
6 > Distill and rebuild Apache, then restart ApacheAnd finally to test if the custom php.ini is working follow the steps :
root@server[#] /usr/local/cpanel/bin/apache_conf_distiller –update
root@server[#] /scripts/rebuildhttpdconf
root@server[#] /etc/init.d/httpd restart
#!/bin/sh # If you customize the contents of this wrapper script, place # a copy at /var/cpanel/conf/apache/wrappers/php5 # so that it will be reinstalled when Apache is updated or the # PHP handler configuration is changed [ -f ~/php.ini ] && exec /usr/bin/php -c ~/ exec /usr/bin/php
# exim -bp
# exim -Mrm {message-id}
# exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
Dallas Marlow, suggested following clean command:
# exim -bp | exiqgrep -i | xargs exim -Mrm
DELETE FROZEN MAILS REMOVE MAILS FROM SENDER/usr/sbin/exim -bp | awk '$6~"frozen" { print $3 }' | xargs /usr/sbin/exim -Mrm
OR/usr/sbin/exiqgrep -i -f (MAIL ADDRESS HERE) | xargs /usr/sbin/exim -Mrm
/usr/sbin/exim -bp | awk '$4~"info@domain.com" { print $3 }' | xargs /usr/sbin/exim -Mrm
if first_delivery
and ( (“$h_from:” contains “emailtoblock@domainname.com”)
)
then fail
endif