Transferring all your cpanel accounts using shell.
First we need to create all accounts backup on your current server, execute following command
cat /var/cpanel/users | while read line; do
/scripts/pkgacct $line
done
All accounts are backuped up under /home, now transfer all accounts backup to your new server using SCP command line.
scp cpmove-* root@new-server-ip:/home
Now to resoter the accounts.
To restore all accounts, put all the users in the file named users on the new server /home
cat /home/users | while read line; do
/scripts/restorepkg $line
done
Howto fix Spam Assassin Ruleset Bug
This bug can result in legitimate mail being flagged as spam.
The cPanel Development team has issued a hot fix that will address this issue and will automatically update the SpamAssassin ruleset to resolve this issue. If you have automatic cPanel updates enabled, no further action is required.
If you do not have automatic cPanel updates enabled, you can manually update the SpamAssassin ruleset by executing the following commands in a root shell:
/scripts/autorepair spamd_y2010_fix
The following error can be seen in the cpanel error_log and when attempting to restart Apache:
UserDir “enable” keyword requires a list of usernames
Newly created websites would be sent to defaultwebpage.cgi instead of the appropriate document root.
Resolutions:
1.) New builds, 11.25.0-CURRENT_42400 and 11.25.0-RELEASE_42400, have been published to address the issue. This issue will not be present on subsequent new installations. Upgrading a currently affected system will resolve this issue.
2.) Rebuilding the Apache configuration after the addition of the first account will permanently resolve this issue.
From the command line:
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
or
/scripts/autorepair userdir_enable_fix
/scripts/restartsrv_httpd
From the WHM:
Service Configuration -> Apache Configuration -> Global Configuration ->
Save -> Rebuild Configuration and Restart Apache
Reference: http://www.cpanel.net/
csf LF_SCRIPT_ALERT option
This option will notify you when a large amount of email is sent from a particular script on the server, helping track down spam scripts.
Spam Protection Alerts
If you want to add some spam protection, CSF can help. Look in the configuraiton for the following:
LF_SCRIPT_ALERT = 0 change this to 1. This will send an email alert to the system administrator when the limit configured below is reached within an hour.
LF_SCRIPT_LIMIT = 100 change this to 250. This will alert you when any scripts sends out 250 email messages in an hour.
This setting will then send an alert email if more than LF_SCRIPT_LIMIT lines appear with the same cwd= path in them within an hour. This can be useful in identifying spamming scripts on a server, especially PHP scripts running under the nobody account. The email that is sent includes the exim log lines and also attempts to find scripts that send email in the path that may be the culprit.
The limit after which the email alert for email scripts is sent. Care should be taken with this value if you allow clients to use web scripts to maintain pseudo-mailing lists which have large recipients.
Reference: http://www.configserver.com
cPanel XML and JSON APIs
cPanel XML API allows you to issue commands to cPanel and WHM using the XML language, while JSON API allows you to submit requests to the system and receive a JSON response. By including these commands in your custom scripts, you can perform functions remotely, without having to access the cPanel or WHM user interface.
There are several possible applications of the XML and JSON APIs. For example, they can make managing a data center easy by allowing you to issue a single command across multiple servers.
The JSON API is much less resource-intensive than the XML API. cPanel highly recommend using the JSON API, especially if performance is important, since it provides much faster results.
Reference: http://cpanel.net