Tutorials  /  Ubuntu

Install and Configure OpenLiteSpeed on Ubuntu 22.04 – Complete Guide

Ccentron Redaktion · January 2025 ·4 min read ·Ubuntu, Tutorial

OpenLiteSpeed is an optimized, open-source web server that can be used to manage and serve sites. OpenLiteSpeed has useful features that make it a strong choice for many installations, including Apache-compatible rewrite rules, a built-in web-based administration interface, and customized PHP processing optimized for the server.

In this tutorial, you will install and configure OpenLiteSpeed on an Ubuntu 22.04 server.

Prerequisites

To complete this tutorial, you will need an Ubuntu 22.04 server with a sudo-enabled, non-root user and the ufw firewall enabled, which you can set up by following the Initial Server Setup with Ubuntu 22.04.

VM

Matching infrastructure at centron

Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1 – Installing OpenLiteSpeed

Before using OpenLiteSpeed, you will need to install it. OpenLiteSpeed provides a software repository that you can use to download and install the server with Ubuntu’s standard apt command.

Begin by updating the package manager cache:

Console
sudo apt update

Then install any pending upgrades:

Console
sudo apt upgrade

If prompted, enter your password, then confirm the installation with Y.

To enable this repository for your Ubuntu system, download and add the developer’s software signing key:

Console
sudo wget -O - https://repo.litespeed.sh | sudo bash

Update the list of repositories to ensure that the newly added repository is scanned by the apt package manager:

Console
sudo apt update

To install the OpenLiteSpeed server and the corresponding LiteSpeed PHP interpreter, run the command:

Console
sudo apt install openlitespeed lsphp81

Step 2 – Setting the Administrative Password

Before testing the server, you will set a new administrative password for OpenLiteSpeed. You can do this by running a script provided by OpenLiteSpeed:

Console
sudo /usr/local/lsws/admin/misc/admpass.sh

You will be asked to provide a username for the administrative user. If you press ENTER without choosing a new username, the default username admin will be used. You can use whatever administrative username you prefer. Then you will be prompted to create and confirm a new password for the account. Put in the administrative password you prefer, then press ENTER again. The script will confirm a successful update:

Step 3 – Connecting to the Server

OpenLiteSpeed should have started automatically after it was installed. You can verify if it started with the systemctl status command:

Console
sudo systemctl status lsws

If your server is not running, you can start the server using systemctl:

Console
sudo systemctl start lsws

Open your browser and navigate to:

Code
http://server_domain_or_IP:8088

Step 4 – Changing the Port for the Default Page

To change the port from 8088 to the conventional HTTP port 80, open the OpenLiteSpeed admin interface:

Code
https://server_domain_or_IP:7080

Log in with your administrative credentials. Navigate to "Listeners", select "Default", and change the port from 8088 to 80. Save the changes and restart the server by clicking "Graceful Restart".

Conclusion

At this point, you have OpenLiteSpeed and PHP installed and running on an Ubuntu 22.04 server. OpenLiteSpeed offers great performance, a web-based configuration interface, and pre-configured options for script handling.

You can now add any HTML, CSS, JS or other files that you wish to feature on your website to the directory located at /usr/local/lsws/Example/html.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Ubuntu
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren