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.
- 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
● 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: Starting OpenLiteSpeed HTTP Server... Jul 12 08:35:11 ubuntu2004 lswsctrl: [OK] litespeed: pid=4556. Jul 12 08:35:13 ubuntu2004 systemd: Started OpenLiteSpeed HTTP Server.
You can also verify the OpenLiteSpeed version with the following command:
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
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:
Find the following line:
And, replaced it with the following line:
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:
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 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:
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
Next, you will need to configure it to use PHP version 8.0.
You can do it by editing the httpd_config.conf file:
Find the following line:
Replaced it with the following line:
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:
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:
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:
Provide your admin username and password and click on the Login button. You should see the OpenLiteSpeed dashboard on the following page:
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!