Tutorials  /  Linux Basics

Install OpenLiteSpeed with PHP 7.1 on CentOS 7 – Full Guide

Ccentron Redaktion · June 2025 ·5 min read ·Linux Basics, Tutorial

OpenLiteSpeed, the free version of LiteSpeed, is a lightweight and high-performance web server solution.

This guide walks you through the process of setting up OpenLiteSpeed along with PHP 7 on a CentOS 7 machine.

Requirements

  • CentOS 7 x64 operating system
  • A user with sudo privileges
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: System Update

Access the server using a sudo-enabled account and initiate a system update with the commands below:

Console
sudo yum install epel-release -y
sudo yum clean all && sudo yum update -y && sudo shutdown -r now

Once the system has restarted, log back in using the same sudo-enabled account.

Step 2: Setting Up OpenLiteSpeed

To get OpenLiteSpeed version 1.4.24 installed on your CentOS 7 system, run the following YUM commands:

Console
sudo rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm
sudo yum install openlitespeed -y

Step 3: Installing PHP 7

To add PHP support via prebuilt packages specifically for OpenLiteSpeed, you need to install modules prefixed with lsphp.

Use the following command to see a list of all available packages that start with lsphp:

Console
yum list lsphp*

To install the frequently used PHP 7.1 components, execute this command:

Console
sudo yum install lsphp71 lsphp71-mysqlnd lsphp71-common lsphp71-gd lsphp71-pdo lsphp71-process lsphp71-mbstring lsphp71-mcrypt lsphp71-opcache lsphp71-bcmath lsphp71-xml -y

Step 4: Set Admin Credentials for the OpenLiteSpeed Web Interface

OpenLiteSpeed provides a convenient graphical interface known as the WebAdmin GUI. Before accessing it, you must set up credentials for the admin account using the following command:

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

When prompted, provide the following input:

  • User name [admin]: <your-admin-username>
  • Password: <your-admin-password>
  • Retype password: <your-admin-password>

Next, enable access to the WebAdmin UI by opening port 7080 on the firewall:

Console
sudo firewall-cmd --zone=public --permanent --add-port=7080/tcp
sudo firewall-cmd --reload

Once configured, launch your browser and navigate to http://203.0.113.1:7080. You might encounter a security warning regarding SSL—bypass it and log in using the admin credentials you just set.

Step 5: Adjust OpenLiteSpeed to Work with PHP 7.1

By default, version 1.4.24 of OpenLiteSpeed is set to use PHP 5.x. Since this setup uses PHP 7.1, you'll need to adjust the configurations in the WebAdmin GUI to match.

Start by selecting Server Configuration, then go to the External App tab. Find the external application labeled lsphp5 and click the second icon (Edit) on the right. Modify the settings like this:

  • Name: lsphp71
  • Address: uds://tmp/lshttpd/lsphp.sock
  • Max Connections: 35
  • Environment:

    PHP_LSAPI_MAX_REQUESTS=500

    PHP_LSAPI_CHILDREN=35

  • Initial Request Timeout (secs): 60
  • Retry Timeout: 0
  • Response Buffering: no
  • Auto Start: yes
  • Command: $SERVER_ROOT/lsphp71/bin/lsphp
  • Back Log: 100
  • Instances: 1
  • Memory Soft Limit (bytes): 2047M
  • Memory Hard Limit (bytes): 2047M
  • Process Soft Limit: 400
  • Process Hard Limit: 500

Click the Save icon at the top right to apply the changes.

Next, open the Script Handler tab and click the Edit icon to update the handler settings:

  • Suffixes: php
  • Handler Type: LiteSpeed SAPI
  • Handler Name: lsphp71

After updating the values, save your changes by clicking the Save icon again.

Now, go to the Listeners section. Use the View icon to access the Default listener's configuration. In the General tab of the Default Listener, click Edit and update the following:

  • Listener Name: Default
  • IP Address: ANY
  • Port: 80

Click Save to store your modifications.

Finally, click the Graceful Restart icon in the upper right corner to restart the server and apply all settings.

Step 6: Verify Your Configuration

Start by updating the firewall settings to allow incoming traffic on HTTP port 80:

Console
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Next, open your web browser and go to http://203.0.113.1. If the setup was completed correctly, you should see a welcome screen displaying the following message:

You have successfully installed the OpenLiteSpeed Web Server!

To check more technical details about the server and PHP environment, navigate to:

http://203.0.113.1/phpinfo.php

Conclusion

You’ve now completed the setup of OpenLiteSpeed with PHP 7.1 on a CentOS 7 server. From installing essential packages to configuring the WebAdmin interface and fine-tuning the PHP settings, your server is ready to deliver fast and reliable web hosting.

With OpenLiteSpeed’s performance-oriented design and the power of PHP 7.1, your applications can run smoothly and efficiently. You can now explore additional configurations, deploy your websites, or integrate security measures like SSL to further harden your setup.

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 Linux Basics
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

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