Installing the LOMP stack (OpenLiteSpeed, MySQL, and PHP) on your VPS server running Ubuntu 24.04 is a straightforward process. Follow the steps below to set it up.
Step 1: Update Your System
sudo apt update && sudo apt upgrade -y
Step 2: Install OpenLiteSpeed
First, you need to install OpenLiteSpeed:
wget https://openlitespeed.org/package/repo/ubuntu/ol/ubuntu-latest.gpg
sudo apt-key add ubuntu-latest.gpg
echo "deb http://rpms.openlitespeed.org/ubuntu/ focal main" | sudo tee /etc/apt/sources.list.d/openlitespeed.list
sudo apt update
sudo apt install openlitespeed -y
Step 3: Install MySQL
Next, install MySQL server:
sudo apt install mysql-server -y
sudo mysql_secure_installation
Follow the prompts to secure your MySQL installation.
Step 4: Install PHP
Install PHP along with the necessary extensions:
sudo apt install lsphp74 lsphp74-mysql lsphp74-xml lsphp74-mbstring lsphp74-curl lsphp74-zip lsphp74-gd -y
Step 5: Configure OpenLiteSpeed to Use PHP
Set the PHP version in OpenLiteSpeed:
sudo nano /usr/local/lsws/conf/httpd_config.conf
Find the following lines and update them to point to the correct PHP version:
74
Step 6: Start OpenLiteSpeed
Start the OpenLiteSpeed server:
sudo /usr/local/lsws/bin/lswsctrl start
Step 7: Access OpenLiteSpeed WebAdmin
Open your web browser and navigate to:
http://your_server_ip:7080
Log in using the default credentials:
Username: admin
Password: 123456
Make sure to change the password after the first login.
Conclusion
By following these steps, you have successfully installed the LOMP stack (OpenLiteSpeed, MySQL, and PHP) on your VPS server running Ubuntu 24.04. You can now start developing your web applications!