LOMP Stack is an acronym for Linux, OpenLiteSpeed, MariaDB and PHP. OpenLiteSpeed is an open-source version of LiteSpeed Web Server. Litespeed servers are essentially known for the best performance and responsive web server and it integrates easily well with different versions of PHP. MariaDB is a database server, Alot of popular CMS uses MariaDB/MySQL as a database backend to store the content so we will be installing that and alot of CMS are based on PHP Language!
Requirements :
- 1GB or more RAM (Depending on what type/size of your website)
- 1vCore or more CPU (The more the better performance)
- 5-10GB of Disk Space (For mainly website and cache)
- Ubuntu 22.04
Step 1 : Update your server
First step is to update your server to look for newer packages and updates for your distribution, Run the following command to update :
apt-get update -y
apt-get upgrade -y
Step 2 : Install OpenLiteSpeed
Now in this step, We will be installing the core component which is our web server. Run the following command to install :
wget -O – https://repo.litespeed.sh | sudo bash
apt update
apt install openlitespeed
OpenLiteSpeed has been installed, We can check the status through running the following command :
systemctl status lsws
Step 3 : Install MariaDB
MariaDB is another part of this tutorial, MariaDB is a database server. Many frameworks or CMS uses MariaDB as it’s database backend to store it’s content. Run the following command to install it :
apt-get install mariadb-server mariadb-client
mysql_secure_installation
Copy the steps as shown in the picture or text :
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Step 4 : Install PHP
OpenLiteSpeed web server comes bundled with one PHP Version which may not be the latest version. We can install different version of PHP through running the following command :
If we are looking to install PHP 8.1 :
apt install lsphp81 lsphp81-{common,mysql}
If we are looking to install PHP 7.4
apt install lsphp74 lsphp74-{common,mysql}
The number 81 or 74 stands for the PHP Versions 8.1 or 7.4, You can install the desired version you are looking for!
You can check your OpenLiteSpeed Installation at :
http://yourip:8088//
Conclusion :
You have configured a LOMP Stack on your Ubuntu 22.04 Machine. This tutorial assumes you are root!