My handy reference page for common cPanel server commands and configurations.
- Verify license
/usr/local/cpanel/cpkeyclt --force– if this doesn’t work, check your license at https://verify.cpanel.net/app/verify
- Change PHP version – go to WHM > MultiPHP Manager
- Change PHP settings – go to WHM > MultiPHP INI Editor
- Manage them use EasyApache or module install – check and uncheck the ones you want.
- Need to install imagick?
- Recheck disk quotas
/scripts/fixquotas– fixes the issue where user’s disk quota/usage aren’t updated immediately.
/usr/local/cpanel/bin/backup --force– manually force WHM backups
/scripts/pkgacct username– manually backup single account
/home/user/cpbackup-exclude.conf(local) file to exclude items from backup
Security & Firewall:
- WP-cron triggering “suspicious process” warnings – can go to WHM > Plugins > ConfigServer & Security Firewall > edit Isf ignore file > put in the rules as per the template is section 8 of this official CSF suite. Reference links: 1, 2
- blocking countries from certain ports (list of country codes)
- Change FTP port
- Disabling ConfigServer & Firewall alert emails. (Run
service lfd restartif changes don’t take.)
- Is pass auth or SSH key auth not working? – go edit
vi /etc/ssh/sshd_configto allow permitrootlogin and pub key authorization.
- Flush DNS –
- Copy database from one to another (in phpmyadmin).
- To get mysql root password
- Is it not working? Not listing the files or showing some weird errors. Try see if it need to allow the Passive Port Range in your firewall. I had to do this after enabling ConfigServer Security & Firewall (CSF).
Random Issues or Website down:
- Check your processes to see if your CPU is completely overloaded. (WHM > Process Manager).
- Check your available disk space (WHM > Show Current Disk Usage).
- Check your email to see if any services are down. Restart them if needed.
- Comprehensive list of common logs.
Features & Packages:
/var/cpanel/featuresdirectory has config files of all your Feature Lists.
/var/cpanel/packagesdirectory has config files of all your packages. Can quickly copy and rename to create new account packages.
Un-common issues (and fixes)
- Can’t create/transfer new user account because of existing user data, check for cruft left behind by old users/domains
/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/CpanelInc/tech-acctinfo/master/acctinfo) domain.com --cruft(replace “domain.com” with your domain)…many places will be listed, check all carefully…you many have many entries under many hostnames, etc.