Atlantic.Net Blog

Install OpenLiteSpeed, MariaDB, PHP8.0 on Ubuntu 20.04

Hitesh Jethva
by Atlantic.Net (272 posts) under Dedicated Server Hosting, Tutorials
0 Comments

OpenLiteSpeed is a free, open-source, and lightweight HTTP web server that is quickly growing in popularity throughout the world. It supports all major operating systems including Linux, FreeBSD, and macOS. OpenLiteSpeed can handle thousands of concurrent connections with low resource usage. It provides a simple and user-friendly web interface that helps you to manage OpenLiteSpeed through a web browser.

In this post, we will show you how to install OpenLiteSpeed, MariaDB, and PHP 8.0 on Ubuntu 20.04.

Prerequisites

  • A fresh Ubuntu 20.04 server on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Ubuntu 20.04 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your Ubuntu 20.04 server, run the following command to update your base system with the latest available packages.

apt-get update -y

Step 2 – Install Openlightspeed

By default, OpenLiteSpeed is not included in the Ubuntu default repository, so you will need to add the OpenLiteSpeed repository to your server. You can add it using the following command:

wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bash

Once the repository is added, install OpenLiteSpeed with the following command:

apt-get install openlitespeed -y

After the installation, start the OpenLiteSpeed service and enable it to start at system reboot:

systemctl enable lshttpd
systemctl start lshttpd

Next, verify the status of OpenLiteSpeed with the following command:

systemctl status lshttpd

Sample output:

● lshttpd.service - OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-07-12 08:35:13 UTC; 23s ago
   Main PID: 4556 (litespeed)
     CGroup: /system.slice/lshttpd.service
             ├─4556 openlitespeed (lshttpd - main)
             ├─4566 openlitespeed (lscgid)
             ├─4595 openlitespeed (lshttpd - #01)
             └─4596 lsphp

Jul 12 08:35:11 ubuntu2004 systemd[1]: Starting OpenLiteSpeed HTTP Server...
Jul 12 08:35:11 ubuntu2004 lswsctrl[4512]: [OK] litespeed: pid=4556.
Jul 12 08:35:13 ubuntu2004 systemd[1]: Started OpenLiteSpeed HTTP Server.

You can also verify the OpenLiteSpeed version with the following command:

/usr/local/lsws/bin/openlitespeed -v

Sample output:

LiteSpeed/1.7.12 Open
	module versions:
	modgzip 1.1
	cache 1.62
	modinspector 1.1
	uploadprogress 1.1
	mod_security 1.4
 (built: Wed Jul  7 02:28:18 UTC 2021) 
	module versions:
	modgzip 1.1
	cache 1.62
	modinspector 1.1
	uploadprogress 1.1
	mod_security 1.4

Step 3 – Change OpenLiteSpeed Port

By default, OpenLiteSpeed listens on port 8088. You can check it using the following command:

ss -antpl | grep 8088

Sample output:

LISTEN    0         4096               0.0.0.0:8088             0.0.0.0:*        users:(("litespeed",pid=4595,fd=22),("litespeed",pid=4556,fd=22))              

It is recommended that you change the default port to 80. To do so, edit the OpenLiteSpeed default configuration file:

nano /usr/local/lsws/conf/httpd_config.conf

Find the following line:

    address                  *:8088

And, replaced it with the following line:

    address                  *:80

Save and close the file, then restart the OpenLiteSpeed service to apply the changes:

systemctl restart lshttpd

Now, open your web browser and type the URL http://your-server-ip. You should see the OpenLiteSpeed default page:
OpenLightSpeed Default Page

Step 4 – Install MariaDB Server

You can install the MariaDB server and client package using the following command:

apt-get install mariadb-server mariadb-client -y

After the installation, start the MariaDB service and enable it to start at system reboot:

systemctl start mariadb
systemctl enable mariadb

You can verify the installed version of MariaDB with the following command:

mariadb --version

Sample output:

mariadb  Ver 15.1 Distrib 10.3.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Step 5 – Install PHP8.0

You can install PHP version 8.0 with other extensions using the following command:

apt-get install lsphp80 lsphp80-mysql lsphp80-common lsphp80-opcache lsphp80-curl -y

After the installation, verify the PHP version with the following command:

/usr/local/lsws/lsphp80/bin/php8.0 -v

Sample output:

PHP 8.0.8 (cli) (built: Jul  1 2021 08:13:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies

By default, OpenLiteSpeed is configured to use PHP version 7.3. You can check the current PHP version using the URL http://your-server-ip/phpinfo.php
PHP 7.3 Page
Next, you will need to configure it to use PHP version 8.0.

You can do it by editing the httpd_config.conf file:

nano /usr/local/lsws/conf/httpd_config.conf

Find the following line:

  path                    lsphp73/bin/lsphp

Replaced it with the following line:

  path                    lsphp80/bin/lsphp

Save and close the file, then restart the LiteSpeed service to apply the changes:

systemctl restart lsws

Now, open your web browser and verify the PHP version using the URL http://your-serverip/phpinfo.php. You should see the following page:
PHP 8.0 Page

Step 6 – Create OpenLiteSpeed Admin User

Next, you will need to create an admin user to access the OpenLiteSpeed admin interface.

Run the following script to create an admin user:

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

Set your admin username and password as shown below:

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: admin

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: 
Retype password: 
Administrator's username/password is updated successfully!

You can now access the OpenLiteSpeed web interface using the URL https://server-ip-address:7080/login.php. You should see the following page:
Openlitespeed login Page
Provide your admin username and password and click on the Login button. You should see the OpenLiteSpeed dashboard on the following page:
Openlitespeed Dashboard Page

Conclusion

Congratulations! OpenLiteSpeed web server is now installed with MariaDB and PHP 8.0 support. You can now host your website using the high-performance OpenLiteSpeed web server – try it on dedicated server hosting from Atlantic.Net today!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources