Introduction
The LOMP stack consists of OpenLiteSpeed, MariaDB, and PHP, making it a powerful solution for hosting dynamic websites. This guide will walk you through the installation of the LOMP stack on Debian 11, which can be effectively hosted on a Windows VPS UK for optimal performance.
Prerequisites
- A Debian 11 server with root access
- Basic knowledge of Linux commands
- An active internet connection
Step 1: Update Your System
Start by updating your package index and upgrading existing packages:
sudo apt update && sudo apt upgrade -y
Step 2: Install OpenLiteSpeed
Add the OpenLiteSpeed repository:
wget -O - https://repo.openlitespeed.org/repo/OpenLiteSpeed.key | sudo apt-key add -
echo "deb https://repo.openlitespeed.org/debian/ bullseye main" | sudo tee /etc/apt/sources.list.d/openlitespeed.list
Update your package index again and install OpenLiteSpeed:
sudo apt update
sudo apt install openlitespeed -y
Step 3: Install MariaDB
Install the MariaDB server package:
sudo apt install mariadb-server -y
Secure your MariaDB installation:
sudo mysql_secure_installation
Follow the prompts to set the root password and secure your database server.
Step 4: Install PHP
Install PHP along with necessary extensions:
sudo apt install lsphp lsphp-common lsphp-mysql lsphp-zip lsphp-curl lsphp-mbstring lsphp-xml -y
Step 5: Configure OpenLiteSpeed
Access the OpenLiteSpeed web admin interface to configure your server:
Open your web browser and navigate to:
http://your_server_ip:7080
The default username is admin
and the password is 123456
. You should change it after the first login.
Step 6: Set Up a Virtual Host
In the OpenLiteSpeed web admin interface, set up a new virtual host for your website:
- Navigate to Virtual Hosts.
- Add a new virtual host with the desired domain name.
- Set the document root to the directory where your website files will reside.
Step 7: Test PHP Configuration
Create a test PHP file in your document root:
echo <?php phpinfo(); ?> | sudo tee /var/www/html/info.php
Access the PHP info page in your browser:
http://your_server_ip/info.php
You should see the PHP information page.
Step 8: Configure Firewall
Allow HTTP and HTTPS traffic through the firewall:
sudo ufw allow 'Nginx Full'
Step 9: Restart OpenLiteSpeed
Restart OpenLiteSpeed to apply all changes:
sudo systemctl restart openlitespeed
Step 10: Conclusion
You have successfully installed the LOMP stack (OpenLiteSpeed, MariaDB, and PHP) on Debian 11. This powerful web hosting solution can significantly benefit from being hosted on a Windows VPS. For additional options, explore various VPS UK Windows solutions, including Windows Virtual Private Server Hosting and Windows VPS Hosting UK for optimal performance and security.