WordPress on CentOS 7 (CyberPanel, LiteSpeed)

Last Revised: October 2, 2021

This tutorial has been created on a Clouding.io VPS. You can create your own VPS from 3€/month.

In addition, you have the possibility to create your VPS with the WordPress image in one click.

PARTNERSHIP

Versions to install

Operating System: CentOS 7
Control Panel: CyberPanel
Web Server: LiteSpeed
Database: MariaDB
Processor: PHP
Cache: Redis (memcached alternative)

Here we leave you a small installation manual from a basic operating system installation of CentOS 7 with the CyberPanel management panel.

Keep in mind that in this installation we are going to use the version of CyberPanel Enterprise that allows the use of LiteSpeed with all its potential, but with certain limitations.

What is it valid for?

  • a domain
  • unlimited subdomains
  • LiteSpeed Cache

Prerequisites

Resources

  • CentOS 7
  • 1 CPU
  • 2 GB RAM
  • 20 GB SSD

The approximate price of an installation of this type can be around € 10.00 / month.

Pre-configuration

The first thing is to make a first update and configuration of the operating system base.

yum clean all && yum -y upgrade
yum -y install yum-utils curl vim unzip wget
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

Once the operating system is installed, the first thing we will configure will be the server time. In this case we will configure the time zone of Madrid.

timedatectl set-timezone 'Europe/Madrid'
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
ntpq -p

Installing CyberPanel

Once we have everything updated and with the time to day, we will configure the CyberPanel.

sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
Initializing…
Valid IP detected…
Checking server…
Checking OS…
Detecting CentOS 7.X…
Checking virtualization type…
Checking root privileges…
You are runing as root…

CyberPanel Installer v1.91

1. Install CyberPanel.
2. Addons and Miscellaneous
3. Exit. 

Please enter the number[1-3]:

We will choose the option “1”.

CyberPanel Installer v1.91

RAM check : 85/2001MB (4.25%)
Disk check : 2/20GB (13%) (Minimal 10GB free space)

1.  Install CyberPanel with OpenLiteSpeed.
2.  Install Cyberpanel with LiteSpeed Enterprise.
3.  

In this case, we will choose the option “2”.

Please note that your server has 2001 RAM
If you are using Free Start license, It will not start due to 2GB RAM limit.

If you do not have any license, you can also use trial license (if server has not used trial license before), type TRIAL

Please input your serial number for LiteSpeed WebServer Enterprise:

At this time we will write the license that we have been given from CyberPanel. It has a format similar to XXXX-XXXX-XXXX-XXXX.

The serial number you input is: xxxx-xxxx-xxxx-xxxx
Please verify it is correct. [y/N]

And we will write “and”.

License key set…
Press Enter to continue with stable version of CyberPanel, or
Please enter beta and then press Enter to install CyberPanel with Python 3.
CentOS 8 will autoamtically proceed with Python 3 branch.

And we will press “enter”.

Please choose to use default admin password 1234567, randomly generate one (recommended) or specify the admin password?
Choose [d]fault, [r]andom or [s]et password: [d/r/s]

It is best to run a random key and point it or give it the one you want. In this case we will press the “r” and write down the password that generates us (it will give it to us at the end of the installation), since it will be necessary for later.

Admin password will be provided once installation is completed…

Do you wish to install Memcached extension and backend?
Please select [Y/n]:

We will tell you that we will not install Memcached. Therefore we will put “n”.

Do you wish to install Redis extension and backend?
Please select [Y/n]:

In this case we do want to install Redis for our WordPress. Therefore we will press “and”.

Would you like to set up a WatchDog (beta) for Web service and Database service?
The watchdog script will be automatically started up after installation and server reboot
If you want to kill the watchdog , run watchdog kill
Please type Yes or no (with captical Y):

This system serves to warn us of possible server crashes. In principle it is interesting to have it. That is why we will write “Yes”.

Installing necessary components…

After a few minutes (approximately 10 minutes) we will have the system fully installed.

CyberPanel Successfully Installed

Current Disk usage : 6/20GB (33%)
Current RAM  usage : 154/1829MB (8.42%)
Installation time  : 0 hrs 6 min 48 sec

Visit: https://10.0.0.1:8090
Panel username: admin
Panel password: xxxxxxxxxxxxxxxx
WebAdmin console username: admin
WebAdmin console password: xxxxxxxxxxxxxxxx

Please change your default admin password

If you need to reset your panel password, please run:
adminPass YOUR_NEW_PASSWORD

If you change mysql password, please modify file in
/etc/cyberpanel/mysqlPassword
with new password as well

Website : https://www.cyberpanel.net
Forums  : https://forums.cyberpanel.net
Wikipage: https://docs.cyberpanel.net

Enjoy your accelerated Internet by
CyberPanel & LiteSpeed Enterprise

If your hosting provider has a firewall, while it is installing, remember to open port 8090 for TCP/UDP, as it will be the default port of the CyberPanel.

If your provider has a network-level firewall

Please make sure you have opened following port for both in/out:
TCP: 8090 for CyberPanel
TCP: 80, TCP: 443 and UDP: 443 for webserver
TCP: 21 and TCP: 40110-40210 for FTP
TCP: 25, TCP: 587, TCP: 465, TCP: 110, TCP: 143 and TCP: 993 for mail service
TCP: 53 and UDP: 53 for DNS service

Would you like to restart your server now? [y/N]:

Once it is installed, we can restart everything so that it remains active. That is why we will write “and”. This will make a reboot of the machine (if you are connected by SSH it will disconnect you).

After a few seconds you can try to access from your Internet browser to the IP address followed by port 8090. It will be something like this:

https://10.0.0.1:8090/

You will be able to access with the user “admin” and the password that has given you.

What will you find in the panel?

Well, practically all the services that a complete accommodation can give you. Database, DNS, FTP, Backups, Email, SSL, PHP, Security…

The first thing we will do is go to the Users section and there to Modify user, selecting the user “admin”. we will fill in the data and our email account, also changing the password.

The next thing will be for the server itself to act as a DNS server. This step can be complex depending on your domain registrar. The first thing we will do is access the section DNS and there to Create Nameserver.

The objective is to create an entry ns1.example.com and ns2.example.com (with your domain) that point to the IP that the server has given you (in the example it will be 10.0.0.1).

The next thing will be to go to your domain registrar and create the corresponding Glue Records. The idea is that there you also create the NS1 and NS2 pointing to the same IP.

Once you have it, you can go to your domain, and put the DNS that we just created: ns1.example.com and ns2.example.com.

The next thing we will do is create a website. For this, we will need a valid domain and that the DNS point to the IP of your machine (in the example, 10.0.0.1). If your hosting offers you free DNS, you can use them, although it is better to use the server’s own system.

Now that we have it, we will go to the DNS section and configure the same DNS as default entries.

Before creating a site, the first thing we will do is Modify the Default Package so that it is much more unlimited than it is. To do this, we will go to Packages and Update package, selecting the only one that appears.

To continue creating all the elements, the next thing will be to create the website with the chosen domain. For this, we will go to Website and in Create Website. There we will fill in the domain data and a main email account where we can receive messages (it cannot yet be from the domain itself).

The next thing we can do is create an email account. To do this, we will go to the section of Email and Create Email.

Once created, we can access from Email and there in Webmail. Remember that to access, you have to indicate the full address of the mail and your password.

Now that we have an email account and the site created, we can access to install our WordPress. If we enter the address of our site https://example.com/, for now, we will see a screen that says that the site is active, but there is nothing installed.

Once we have the site created, we can go to the list of websites, where we will find our domain and a link to Gestionar.

By accessing the site panel, we will have a lot of quite intuitive options to understand what they mean.

The quickest and easiest option is to use the one-click installer at the bottom of the page. This will allow us to create everything we need without having to do it manually (the database and the basic configuration).

It will ask us for some data for the creation of the site (Site Name, username, password, mail …)

And that’s it! Now we have the site installed in that domain with the data we have put.

Remember that you have to configure the LiteSpeed Caché plugin optimally to obtain perfect results. In addition, also the Backups and other elements to make your WordPress safe.

To do a performance test with a certain sense (similar to what a real site could be) we will use the Visual Test system in which several examples of content are included (texts, images, tweets, Youtube videos …).

Load and performance testing

Doing a load test (you can see the results in WebPageTest), you will see that the TTFB is between 0.05s and 0.10s and the rendering time from 0.04s to 0.06s. Why does it finally take longer to charge (about 2.5s on the first visit)? In most cases, all errors (to call it in some way) are due to external elements.

If we take a URL in which there is image but not external elements, we will see that the thing changes a lot… In this case, looking at the results of WebPageTest, you can see that the loading of the page is done in 0.8s, having a TTFB of 0.08s; even, depending on the Internet connection, it can be loaded in much less time, such that 0.6s, as you can see in these WebPagetest results.

If we do a test with LoadImpact, we have that on average, the response time is 300ms-350ms. This analysis is quite brief and with a maximum of 25 concurrent users.

Although, we can get some more data with blazeMeter analysis. In this case, it is an analysis that lasts 4 minutes with 50 concurrent users. The average times, as can also be seen, are also between 300ms-350ms without consumption rising excessively.

Undoubtedly, this system, with so few resources, gives to set up a powerful site, with many possibilities and very cheap.


About this document

This document is regulated by the EUPL v1.2 license, published in WP SysAdmin and created by Javier Casares. Please, if you use this content in your website, your presentation or any material you distribute, remember to mention this site or its author, and having to put the material you create under EUPL license.