WHM Scripts for Easy Server Setup

Web-based control panels like cPanel/WHM are great for simplifying tasks that would normally require you to login to your server via SSH and run programs from the command line.  For batch tasks, however, the command line is often a better choice.  Fortunately, there are numerous WHM command line scripts that you can execute from within a secure shell.  These are also convenient if you are already logged in via SSH anyway and need to perform some cPanel tasks.

You can locate cPanel and WHM scripts in the following directory on your server: /usr/local/cpanel/scripts

Some of the useful scripts include:

easyapache – A quick tool to upgrade and reinstall Apache (With cPanel installed, you should not install Apache using normal methods)

*up – This allows you to update a number of services.  Some of the scripts are:

mysqlup (to update MySQL)
phpup (to update PHP)
eximup (to update Exim)

wwwact – Use this script to add an account to cPanel

runstatsonce – Updates statistics for all user accounts

cpbackup – Creates backups for all cPanel accounts

There are many more scripts that you can find in the cPanel scripts directory.  cPanel recommends you only run scripts listed on their help page, as others may have been placed there incorrectly or maliciously.  When you want to run one of the scripts, use the full path like this:


Generally speaking, these scripts should function just as the tasks would within your control panel.  If you have any issues or questions about how to use the scripts, you can consult the WHM documentation, which is usually pretty clear.

Dedicated Servers