As a most popular web hosting control panel, cPanel is well known and based on Linux Operating System to manage Linux servers and hosts worldwide. While learning and using cPanel is easy, you will be able to save time and money. To compress some or all of your website files before sending them to the internet, you need to Optimize Website Content in cPanel. This article will be a solution to Optimize And Improve Speed cPanel/WHM. Do not miss new offers and discounts on Eldernode to buy your own Linux VPS.
Table of Contents
How to Optimize And Improve Speed cPanel/WHM
If you are one of the users who wish to Optimize and improve the speed of cPanel, stay with us and follow this guide to the end.
Optimize And Improve Speed CPanel Step By Step
Let’s go through the steps of this guide to learn How to Optimize And Improve cPanel speed. There are 5 suggested steps include an explanation that helps you optimize cPanel and speed up it.
Previously, you have learned how to install CloudLinux on cPanel. When you install CloudLinux on cPanle, you are improving the stability because it limits the resources. The security and efficiency will be increased, multiple PHP version and Hardened kernel are other features of this integration. In this way, you can provide an admin interface within cPanel and WHM software to manage account usage easily.
While you log in as a root user, open an SSH account and run the following commands:
sh cldeploy -k <activation_key> # if you have activation key or
sh cldeploy -i # if you have IP based license
Install LiteSpeed webserver
LiteSpeed is a proprietary web server built as a drop-in replacement for Apache. To install LiteSpeed you need to consider some prerequisites such as a LiteSpeed Web Server license. In case you do not prefer to buy a license, you can use the Free Starter plan on a server with less than 2GB of memory. Since it only works with LiteSpeed Enterprise Edition, you need to provide a trial key or an Enterprise License serial number. SSH root access to the cPanel server with root privileges is also required. In the following, you will review the steps of installing the LiteSpeed Web Server plugin for cPanel/WHM.
You are recommended to install the WHM PLUGIN LSWS through one line auto-installer. Here are the steps of installing the whm plugin, LSWS, and PHP.
1. Install LiteSpeed WHM plugin
As we mentioned, you need SSH access, so run the command below from ssh and as root.
cd /usr/src; curl https://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh | sh Uninstall WHM
You can uninstall the WHM LiteSpeed plugin by running the following command:
2. Install LiteSpeed Speed Web Server from within WHM
To pass this step, follow the path below one by one:
1- Click the “LiteSpeed Web Server” plugin
2- Click “Install LiteSpeed Web Server”
3- Fill in the form to specify
Then, consider the following tips:
_ Trial license key or serial number
_ LiteSpeed target installation directory
_ Port Offset (set to 0 to replace Apache otherwise set a number like “2000” for example to try LiteSpeed on port 2080)
_Whether to enable PHP SuEXEC
_ Your Administrators email address.
_ Username and password for LWSW WebAdmin Console
4- Click ”Next” to install LiteSpeed
3. Config PHP
The plugin will handle EA4 through the script. The plugin of LiteSpeed will detect the right configuration and correct them when needed. So, you do not need to build matching PHP.
You should build a matching PHP binary for EA3. Although the LSWS comes with a pre-built PHP 4 binary, you must build your own PHP using configuration options matching those used by Apache mod_php. Then, click ”build Matching LSPHP” and be aware that this will take a while.
You may see one of the following error messages when running ”Build Matching LSPHP”, try increasing ”Max cPanel process memory (minimum: 512)” in the side menu under Server Configuration Tweak Setting to at least 512MB.
ERROR: /usr/local/bin/php -i returns 6
You can try to build matching PHP from command line: "/usr/local/cpanel/whostmgr/cgi/lsws/cmd_buildmatchingphp.sh"
Found Errors ERROR: /usr/local/bin/php -i returns 134 You can try to build matching PHP from command line: "/usr/local/cpanel/whostmgr/cgi/lsws/cmd_buildmatchingphp.sh"
4. Start LiteSpeed again
To start LiteSpeed, click ”Restart LiteSpeed”. If you have passed the above steps carefully, all should be ok and working now. So, it is time to replace Apache with LiteSpeed Web Server. To do this, click ”Change Port Offset” and set the value to 0 if you had not done so previously. Next, click ”Switch to LiteSpeed” to finish it.
Very Important: Do not uncheck the ”Apache Web Server” service under WHM’s service manager. If you do, WHM will not restart LiteSpeed automatically when configuration changes have been made.
Upgrade MySQL database to MariaDB
In this step of Optimize and improve cPanel speed, you need to upgrade from MySQL to MariaDB. It would not be so challenging since MariaDB is designed to be a drop-in replacement for MySQL. In the following, you will learn how to install MariaDB over your MySQL server. You will be successful to proceed with this migration if you go through the below steps as the simplest method.
1- Update your software repositories list with the MariaDB repos
2- Update your Linux package manager with the new repos
3- Stop MySQL
4- Install MariaDB with the package manager
All the above steps should be done after you prepare the backup. You can reliably switch to MariaDB and then switch back to MySQL. Choose your distro, MariaDB version, and download mirror, then copy and run the command created by the wizard to install the repository signing key, and copy the repository configuration into your source list. Next, run your package manager’s update command, stop your MySQL server, and then install MariaDB with your package manager. Your package manager should run mysql_upgrade automatically. This is a necessary step to check all your tables for compatibility with the current version of the MariaDB and fix anything that is not right. If it does not, run mysql_upgrade manually. Then restart MariaDB, check your log files, and if no error appears, you’re done.
Modules Activation via EasyApache (Learn Optimize And Improve Speed CPanel)
In this step to increase the efficiency of cPanel, you can activate important modules from EasyApache. It is a powerful and simple-to-use tool built into WHM/cPanel that you can use to update and configure your Apache webserver. Follow the below path to be able to install modules via EasyApache.
Login to WHM (as root user) > Click on ”software” > Select EasyApache3 > Select the apache version and click on ”Next step” > Once you are entered to another page, change the pho version and click on the button ”Next Step” > Click on ”Exhaustive Option List” to enable the module > Select the module you wish to install > Click on ”Save and Build” > Click on OK to confirm the action when a new window is opened.
In this way, the build page will display. The Apache rebuild will take almost 45 minutes. Now, the modules are installing via EasyApache.
Disable unnecessary services
The latest way of increasing cPanel speed is to disable unnecessary services in cPanel. cPanel monitors all services installed on the server by using the ”Chkservd” daemon. It monitors all services installed on the server and restarts or tries to restart them automatically if any services are stopped for some reason. Manage it from the WHM panel simply or from the server CLI. Disable services reside in the /var/Cpanel/disabled directory. Let’s see how to disable services from the cPanel monitoring, just follow the below steps.
1- Log in to WHM as root
2- Go to ”Home > Services Configuration > Service Manager >
3- Uncheck the service from the ”Monitor” column
How to disable a service from Chkservd via CLI
In case you want to disable the service from the command-line interface, review the steps below:
1- SSH to server as root
2- Open the Chkservd configuration file ”/etc/chkserv.d/chkservd.conf” with your favorite file editor
3- Diasbale service by using 0
4- Restart ”Chkservd” service.
In this article, the Tutorial Optimize And Improve Speed cPanel/WHM present to you. Now, you can choose and use any of the five solutions to speed up and optimize cPanel. Find your preferred VPS hosting plans to have a powerful control panel. In case you are interested in learning more, visit cPanel tutorials.