OpenLiteSpeed is a free, open-source and high-performance web server that can be used to host your website easily. It is an open-source version of the LiteSpeed Server developed by LiteSpeed Technologies. It is one of the fastest web servers around the globe and supports thousands of concurrent connections. It offers a lot of useful features that make it a solid choice for many installations.
- Apache-compatible rewrite rules.
- Built-in web-based interface.
- Event-Driven Architecture.
- HTTP/3 & HTTP/2 Support.
- Support multiple PHP versions.
- Multi-Thread Module.
- WAF, Anti-DDoS and Bandwidth throttling.
In this tutorial, we will show you how to install OpenLiteSpeed on your Ubuntu 20.04 cloud server.
- A cloud server running Ubuntu 20.04.
- A root password set up in your server.
By default, OpenLiteSpeed is not available in the Ubuntu 20.04 default repository. So you will need to add OpenLiteSpeed official repository to your system. You can add it with the following command:
wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bash
Once the repository is added, install the OpenLiteSpeed with the following command:
apt-get install openlitespeed -y
After installing OpenLiteSpeed, you can proceed to the next step.
Enable PHP Support
By default, the latest version of PHP is not available in OpenLiteSpeed. At the time of writing this tutorial, the latest version of PHP is 7.4. You can install the PHP 7.4 by running the following command:
apt-get install lsphp74 -y
Once installed, you will need to create a symbolic link of the installed package:
ln -sf /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
Next, start the OpenLiteSpeed service with the following command:
At this point, OpenLiteSpeed is started and listening on port 7080. You can check it with the following command:
netstat -plntu | grep 7080
You should get the following output:
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 6274/openlitespeed udp 0 0 0.0.0.0:7080 0.0.0.0:* 6274/openlitespeed udp 0 0 0.0.0.0:7080 0.0.0.0:* 6274/openlitespeed
Set OpenLiteSpeed Admin Password
You will also need to generate an administrative password of OpenLiteSpeed if you want to access OpenLiteSpeed control panel. You can generate it with the following script:
You will be asked to provide 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]: openadmin
Please specify the administrator's password.
This is the password required to login the administration Web interface.
Administrator's username/password is updated successfully!"
Access OpenLiteSpeed Control Panel
Now, open your web browser and type the URL https://your-server-ip:7080. You will be redirected to the following page:
Provide your admin username, password and click on the Login button. You should see the OpenLiteSpeed default dashboard in the following screen:
Change the 8088 Port to the Default 80
By default, OpenLiteSpeed uses port 8088 for http traffic. So it is recommended to change this port to 80.
Click on "Listeners" in the left pane, you should see the following page:
Click on the "View" button. You should see the following page:
Click on the "Edit" icon on your top right, you should see the following page:
Now, change Port from 8088 to 80 and click on the "Save" button and restart OpenLiteSpeed to apply the changes.
Now, open your web browser and access the OpenLiteSpeed default website using the URL http://your-server-ip. You should see the following page:
In the above guide, you have learned how to install OpenLiteSpeed on Ubuntu 20.04 server.
You also have learned how to enable PHP 7.4 support and change the HTTP default port.
Now you can easily create a new website with OpenLiteSpeed web-based control panel! For more information, visit the OpenLiteSpeed official documentation.