• Skip to primary navigation
  • Skip to main content
  • Skip to footer

WPJohnny

WordPress Performance Guides and Reviews

  • Start a WordPress site
  • Hosting
  • Themes
  • Plugins
  • Blogging
  • Marketing

WHM cPanel cheatsheet (configs, commands, fixes)

WordPress hosting Feb 13, 2020 by Johnny

My handy reference page for common cPanel server commands and configurations.

License:

  • Verify license /usr/local/cpanel/cpkeyclt --force – if this doesn’t work, check your license at https://verify.cpanel.net/app/verify

PHP:

  • Change PHP version – go to WHM > MultiPHP Manager
  • Change PHP settings – go to WHM > MultiPHP INI Editor

Modules:

  • Manage them use EasyApache or module install – check and uncheck the ones you want.
  • Need to install imagick? ea-php74-pecl install imagick to install imagick for php 7.4.
  • WP-CLI – yum install wp-cli -y to install, then yes | wp cli update to update
  • /opt/cpanel/ea-php74/root/usr/bin/php -v checks if ioncube installed for php 7.4. yum install ea-php74-php-ioncube10.x86_64 -y installs it for php 7.4.

Disk management:

  • Recheck disk quotas /scripts/fixquotas – fixes the issue where user’s disk quota/usage aren’t updated immediately.

Backups:

  • /usr/local/cpanel/bin/backup --force – manually force WHM backups
  • /scripts/pkgacct username – manually backup single account
  • use /etc/cpbackup-exclude.conf (globally) or /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 restart if changes don’t take.)

SSH:

  • Is pass auth or SSH key auth not working? – go edit vi /etc/ssh/sshd_config to allow permitrootlogin and pub key authorization.

DNS:

  • Flush DNS – rndc flush

Database:

  • Copy database from one to another (in phpmyadmin).
  • To get mysql root password cat /root/.my.cnf
  • /etc/redis.conf redis configuration file

FTP:

  • 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.

Logs:

  • Comprehensive list of common logs.

Features & Packages:

  • /var/cpanel/features directory has config files of all your Feature Lists.
  • /var/cpanel/packages directory has config files of all your packages. Can quickly copy and rename to create new account packages. (Or use the WHM transfer tool to copy packages across servers.)

LiteSpeed commands:

  • change license key – echo "YOUR-LICENSE-KEY" > /usr/local/lsws/conf/serial.no
  • update license – /usr/local/lsws/bin/lshttpd -r
  • restart LiteSpeed – /usr/local/lsws/bin/lswsctrl restart

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.

Share this post:

Share on FacebookShare on TwitterShare on LinkedInShare on WhatsAppShare on EmailShare on SMS

Read all my posts on WordPress hosting

About Johnny

Right on the edge of WordPress development! 10+ years of WordPress design, development, hosting, speed optimization, product advisor, marketing, monetization. I do all that.

More WordPress Guides

WordPress Multilingual Guide 2016 – Plugin Review, Language Translation Strategy, and WPML Tips

MailOptin Email Lead – WordPress plugin review

Expected conversion rate for membership sign-ups?

Why WordPress SUCKS (and how it could be better)

FREE Web Hosting Control Panel Review

Noob Guide to Gutenberg

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

More links

  • Gadget reviews
  • Try my free WPJ plugins
  • Join the WPJ FB Group
  • WPJ YouTube & newsletter
  • Become a WPJ Affiliate

Popular Reviews

  • Best WordPress Hosting
  • Best WordPress Themes
  • Best WordPress Plugins
  • Best WordPress Cache Plugins

Services

  • Speed optimization
  • Speed optimization courses
  • WordPress hosting
  • Hire me or other experts
  • Client login

About Johnny

10+ years of WordPress design, development, hosting, speed optimization, marketing.
Contact me.

newsletter block

Copyright 2022 | WordPress guides by Johnny Nguyen

Click to Copy