A guide on installing & optimizing cPanel/WHM on your dedicated server
Since 1GServers got it’s start in 2012, we have been assisting our customers that wish to make it easier to manage their website, or those that wish to provide web hosting services, install and optimize cPanel/WHM. It’s actually very easy to get started using cPanel/WHM, but it’s also important to make sure it’s setup optimally. This will help make it easier on you by assuring cPanel/WHM is operating at it’s best.
Before getting started, take note that cPanel/WHM is to be only installed on a blank server. It needs a blank server because the installer will be overwriting data on your server. The blank server should be installed with the latest version of CentOS, and be up to date with the latest updates.
Ready to get started now? 1GServers offers industry leading automated server deployment technology to have your CentOS & cPanel/WHM ready dedicated server available for you within 20 minutes. Visit our Auto Deploy Servers page to get started.
Installing cPanel/WHM
Some things to note before starting the installation:
- SELinux needs to be disabled.
- Networking is configured properly and you have proper Internet access.
- DNS Resolvers in /etc/resolv.conf are set.
To get the installation process started, run the following command from the SSH prompt:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
The installer will take a long time to finish. Now would be a great time to get up & stretch, and if you’re like me, the perfect opportunity to get a refill.
When the installer is complete, you’ll be able to login to cPanel/WHM at:
https://YOUR-IP-ADDRESS:2087/
(Be sure to replace YOUR-IP-ADDRESS with the actual IP address of your server)
You will login with your server’s root user login details.
From here, you will see the configuration wizard which will guide you through the remainder of the setup process.
Tips For Optimizing cPanel/WHM
There’s no question that cPanel/WHM is the most used web hosting control panel, as it provides great flexibility, extensive features, and a very user friendly interface. It makes the task of managing all aspects of your website and web hosting business very easy.
Having said all that, the setting defaults in cPanel/WHM are not the most ideal. Here at 1GServers, we’ve found it very helpful to tweak several of the configuration settings that we’ve found not to be the most optimal. Here are our recommended optimizations that will help you get the most out of your cPanel/WHM implementation.
- PHP: We highly recommend that you configure PHP with FastCGI and SuExec. This results in higher performance as well as more sane security restrictions. Do not configure PHP in DSO mode, as that will result in a script having access to all files, even those that do not belong to the same user account. Therefore, with FastCGI mode with SuExec will prevent what would otherwise be a very easy security attack vector by a malicious script.
- E-mail: You’ll want to tweak the e-mail protection mechanisms in your cPanel/WHM installation. In general, you’ll want to make sure that if any account on the system starts sending out spam, it’s much easier to track down the source of the problem and stop it. You will want to make sure that the settings only allow for so many e-mails per hour per account. You’ll also want to enable the SpamAssasin and BoxTrapper features. SpamAssasin allows you to filter and classify e-mail for the purposes of blocking SPAM/UCE. BoxTrapper filters SPAM/UCE from your inbox through a challenge-response verification process and is very effective.
- CPHulkD: By default, the CPHulkD process has settings that could make it rather easy for you to get the root account locked out. It is therefore recommended to reconfigure the CPHulkD process to have a higher probability of blocking attacking IP’s, with a lesser probability of blocking user accounts. With these tweaks, an attacker will be quickly blocked, while users will still be able to get into their accounts.
- Apache: Modern servers have high amounts of RAM and CPU processing power available to them. You’ll want to make sure that Apache is able to utilize more resources so that you’re taking full advantage of the scaling capabilities of your server. This is especially true when installing cPanel/WHM on a dual processor server. While it’s impossible for us to provide specific tweaks that will be best for every workload, we can however provide some generic advice. You’ll want to allow Apache to serve the maximum number of simultaneous requests possible, while keeping the settings sane. You’ll want to increase the minimum spare servers as well as the keepalive timeouts. This greatly improves performance.
- PHP & Apache Modules: You’ll definitely want to recompile PHP & Apache with the more popular modules. These include, but are not limited to, CURL, IonCube, TTF, and GD. By building more modules into PHP & Apache now, you’ll have a head start before you get customers requesting them, or for when you are installing software that requires them yourself. There’s no harm in including modules now.
If you’re a newcomer to cPanel/WHM, or even an experienced veteran, it can seem to be a tedious and overwhelming process to optimize. This article should be sending you in the right direction, so that you know what to start of tweaking to get the best performance for your deployment.
Ready to get started now? 1GServers offers industry leading automated server deployment technology to have your CentOS & cPanel/WHM ready dedicated server available for you within 20 minutes. Visit our Auto Deploy Servers page to get started.
If you need assistance or guidance on how to further optimize cPanel/WHM on your server with 1GServers, please don’t hesitate to reach out to us by opening a ticket in our helpdesk. We’re done the hard work through the years and we know just the right settings to tweak that will get the best performance for a majority of our customers.