How to install OpenLiteSpeed on Ubuntu 18.04 / 20.04 Server
Login to the Ubuntu server & follow the below steps to install openlitespeed
Step 1:Add OpenLiteSpeed Repository to Ubuntu
$ wget -O – http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash
Step 2: Update the server before installing a new package
$ sudo apt update
Step 3: Install openlitespeed
$ sudo apt install openlitespeed
Step 4: Install PHP on Ubuntu
The commonly used PHP version in openlitespeed is 7.4.
$ sudo apt-get install lsphp74
Step 5: Install soft link to direct OpenLiteSpeed to use the installed PHP.
$ sudo ln -sf /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
Step 6: Start the server
$ sudo /usr/local/lsws/bin/lswsctrl start
The output should be “OK” as mentioned below.
Output:
[OK] Send SIGUSR1 to 94667
Step 7: Set the Administrative username & Password
$ sudo /usr/local/lsws/admin/misc/admpass.sh
Step 8: Access OpenLiteSpeed Web Admin onUbuntu with the default port 7080 on browser
Use the URL as mentioned http://your-server-ip:7080 & provide the username & password as per in step 7
Step 9: Create a new Test Virtual Host on OpenLiteSpeed
From the interface, click on the “Virtual Hosts” tab and click on + symbol then fill the details accordingly and click on the save icon.
Step 10: Check openlitespeed virtual host on browser
By default, the OpenLiteSpeed virtual host accepts connections on port 8088. Check the browser with the below URL
Step 11: Create sample PHP file on Ubuntu to check functionality of web server
Create a new file with the favorite text editor in /usr/local/lsws/Example/html
$ sudo vim /usr/local/lsws/Example/html/test.php
Copy & paste the following content then save & exit the file
<html>
<head>
<?php
echo ‘<title>Sample PHP Script</title>’;
?>
</head>
<body>
<?php
echo ‘<p>This is to confirm that our PHP is working</p>’;
?>
<h1>OpenLiteSpeed</h1>
<p>OpenLiteSpeed is a high-performance, lightweight, open source HTTP
server edition of LiteSpeed Web Server Enterprise</p>
</body>
</html>
Step 12: Check the functionality of openlitespeed on browser with the below URL
http://your-server-ip:8088/test.php
Step 13: Change the Virtual Host Listening Port from 8088 to 80
From the openlitespeed interface,Click on Listeners >> View . On that page, click on the edit icon to alter with the defaults then save the configuration by clicking the save icon.
Step 14: Restart the openlitespeed web server by clicking on the grace restart icon on the interface