Table of Contents

INTRODUCTION

+ OpenLiteSpeed, the open source edition of LiteSpeed, is a high performance yet light-weight web server application.

+ In Part 1, I will guide you through the process of installing and configuring an OpenLiteSpeed instance on your server. We will also install and configure MariaDB to facilitate interaction with many common web applications and services. WordPress will not be installed at this time. Part 2 will cover the installation of WordPress.

+ One more thing you should know that, What Cloud Hosting does, Cloud Server can do better. As a result, you can use everything you’ve learned from this tutorial to apply to Cloud Server without any problems at all

NOTE:

+ The OpenLiteSpeed and LiteSpeed web server are two distinct products. If you want to learn more about this specific difference, please refer to this post

PREREQUISITES

+ Before you begin this guide, there are some important steps that you must complete to prepare your server

    • A Centos OS7 x 64 server (Cloud Hosting or Cloud Server) instance

+ If you have not had a Cloud Hosting or Cloud Server. BUY RIGHT NOW  so that you can start leaning and practicing with 1Byte

Let's GET YOUR HANDS WET

Step 1: Reset your Cloud Server/ Cloud Hosting

+ You can skip this step if your Server (Cloud Hosting or Cloud Server) is brand new.

+ However, if your Server (Cloud Hosting or Cloud Server) was previously used for a specific purpose, such as putting up a website, building an application,…etc. Then these existing packages and current setup configurations are likely to conflict with packages and configuration that will be deployed in the future.

→ Reset your Server is a MUST and don’t forget to backup your data before RESETING

Playlist

2 Videos

Step 2: Login into your Cloud Server/ Cloud Hosting

+ There are 2 ways to login

Playlist

2 Videos

Step 3: Update the system and install some basic tools

+ Regardless of what you decide to do, you should first make sure that all of your packages is up to date.

				
					#Run these commands one-by-one
yum install epel-release -y
yum clean all && sudo yum update -y && sudo shutdown -r now
				
			

+ After running the above command, you will get disconnected from the server, because the server is rebooting and remember to login to the server again to be able to perform the steps below

+ Afterwards, we’ll need to install the wget, unzip and nano packages. These commands will come in handy in the future.

+ If a package is already installed on the Server, skip that package and install the next one.

				
					#Remember to run these commands one by one
rpm -q nano                     #Checking
sudo yum install nano -y        #Installing

				
			
  • Nano: a command-line based text editor

Step 4: Configure yum.conff

+ By default, 1Byte provides the Server with a configuration (yum command) that blocks you from installing certain packages. Unfortunately, several of the OpenLiteSpeed Web Server packages are among these, thus we will remove them from that configuration from yum command.

				
					nano /etc/yum.conf
				
			
As you can see, we cannot install the "httpd", "PHP", "MySQL", and "MariaDB" package because it is currently excluded

→ You must remove these packages from the exclude line (final line). If you’re still confused, check out the video below. 

Step 5: Install OpenLiteSpeed Repository & Its Components

+ Add the repository

				
					rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

				
			

+ Install OpenLiteSpeed from repository

				
					yum install openlitespeed -y
				
			

+ The following commands will install PHP 7.4 for OpenLiteSpeed from our repository with all commonly-used packages, and direct OpenLiteSpeed to use this PHP. This build of PHP should be enough to support the most commonly used web applications.

				
					
#Install PHP version 7.4
yum install lsphp74 lsphp74-json lsphp74-common lsphp74-gd lsphp74-imagick lsphp74-process lsphp74-mbstring lsphp74-mysqlnd lsphp74-xml lsphp74-opcache lsphp74-mcrypt lsphp74-pdo lsphp74-imap lsphp74-bcmath lsphp74-pecl-memcache lsphp74-pecl-memcached lsphp74-pecl-redis lsphp74-pgsql lsphp74-zip -y

#Link PHP of OpenLiteSpeed to the new PHP Version 7.4
ln -sf /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp74

				
			

+ With all of our components installed, we can now take care of some configuration.

Step 6: Change the Default Admin Password for OpenLiteSpeed

+ First, we should change the default administration password for OpenLiteSpeed. By default, this is set to “123456. This password is very weak and easy to guess, so we must modify this value immediately.

+ To change the password, execute the following script:

				
					/usr/local/lsws/admin/misc/admpass.sh
				
			

+ You can optionally select a new username for the administrative account, or just press ENTER to accept the default value of admin. Afterwards, you will have to supply and verify a password for the administrative user. Make sure to select a strong password because the administrative login screen is open to the web by default.

NOTE:

+ This username and password at this step will be used to login into WebAdmin Console

→ Please write down or keep note your credential

+ If you are still confused, check the video below

Step 7: Install, Star, and Secure the MariaDB System

+ Next, we need to install MariaDB version 10.6 and start the MariaDB database system as well as do some simple configuration

				
					#Add MariaDB into Repository
echo '[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1' > /etc/yum.repos.d/MariaDB.repo

#removes the cache of repositories
yum clean all

#Update all packages again
yum update -y

#Install MariaDB version 10.6
yum install MariaDB-server MariaDB-client -y

#Start MariaDB
systemctl start mariadb

#Enable MariaDB after machine reboot
systemctl enable mariadb

				
			
your mariadb.service should be in active status

+ With MariaDB online, we can run a simple security script to set an administrative password and lock down some insecure defaults:

				
					sudo mysql_secure_installation
				
			

+ First, it will ask you for the MariaDB root password. Since we have not set one yet, just press ENTER to continue. The very next step asks you to set a root password. Select and confirm an administrative password for the database system.

+ For the remainder of the questions, you can just hit ENTER to accept the default suggestions. This will revert some insecure settings on our database system.

+ If you are still confused, check the video below

+ Finally, reset MariaDB service to take effect

				
					systemctl restart mariadb
				
			

Step 8: Configure firewall-cmd

+ By default, the WebAdmin Console (admin page) runs on port 7080.

+ Therefore, to allow yourself to access via port 7080 (WebAdmin Console). This port must be opened.

				
					#Check all opened ports
firewall-cmd --list-all

#Allow port 7080 for WebConsole Admin Page
firewall-cmd --permanent --zone=public --add-port=7080/tcp

#Reload to take effect
firewall-cmd --reload
				
			
By default, server does not open port 8080, 7080
Port 7070 were added into firewall-cmd

Step 9: Test Out the Default Web Page and Admin Interface

The OpenLiteSpeed server should already be up and running. If you need to start, stop, restart, or check the status of the server, use the standard service command with the lsws service name:

				
					#Check Status server
sudo systemctl status lsws

#Start
sudo systemctl start lsws

#Stop
sudo systemctl stop lsws

#Restart
sudo systemctl restart lsws
				
			
your httpd.service should be in active status

+ In your web browser, you can check out OpenLiteSpeed’s WebAdmin Console page. Navigate to your server’s IP address, followed by :7080 to specify the port:

 

				
					http://<server-ip>:7080
				
			

+ You will likely see a page warning your that the SSL certificate from the server cannot be validated. Since we have not installed SSL certificate for this website, this is expected. Click through the options available to proceed to the site (in Chrome, you must click Advanced and then choose Proceed to… )

 

Click Advance button
Then click Continute to go WebConsole Admin

+ You will be prompted to enter the administrative name and password that you selected in Step 6

 

Input your username and password created in Step 6

+ Once you correctly authenticate, you will be presented with the OpenLiteSpeed administration interface (WebConsole Admin)

You will see the default WebConsole Admin web page, look like this

Step 10: Change the port of Default Page (Port 8080)

+ As explained above, we now will change the port that the default site is using from 8088 to the conventional port 80

1) On the left-bar menu, choose Listeners option

2) In column Listener Name, click  on Default

3) Click the Edit button in the top-right corner of the Address Settings table to modify its values

4) Chnage port 8080 to port 80, and click on icon Save

5) Finally, you need to click on Gracefull Restart button. It is a square button, green background with white arrow icon, located on the top right hand side

+ If you still get confused, please check out the video below

+ The default web page should now be accessible in your browser on port 80 instead of port 8088. Visiting your server’s domain name or IP address without providing a port will now display the site.

				
					http://<server-ip>:80

#or you don't need to put :80
http://<server-ip>
				
			

+ You will see a page the default OpenLiteSpeed web page, that looks like this:

Default Page of OpenLiteSpeed Web Server

BRAVO!

+ At this point, you should have OpenLiteSpeed, a customized version of PHP, and MariaDB installed and running on a CentOS 7 server. OpenLiteSpeed offers great performance, an easy-to-use interface, and pre-configured options for script handling. Dive in and learn the ropes to start leveraging these capabilities to serve your sites.

+ Up to now, OpenLiteSpeed web server is still missing the following features:

1) No SSL Certificate yet

2) Haven’t installed WordPress yet

+ Make no fear, 1Byte will be by your side to help you implement all the missing features in Part 2 – Install WordPress and Part 3 – Install SSL over OpenLiteSpeed web server

STAY TUNED!!!