How To Install the OpenLiteSpeed Web Server on CentOS 8

OpenLiteSpeed is an open-source, high-performance and lightweight HTTP web server that comes with a web administration interface to manage and serve web sites.

As far as concerned about Linux web servers, OpenLiteSpeed has some impressive features that make it a preferred choice for many installations, as it comes with Apache compatible rewrite rules and optimized PHP processing for the server that can handle thousands of concurrent connections with low CPU and Memory consumption.

In this article, we will guide you through the process of installing and configuring OpenLiteSpeed on CentOS 8 server with PHP processor and MariaDB database management system.

Add the OpenLiteSpeed Repository

To install the latest version of OpenLiteSpeed, you need to add the official repository information to our system by running.

# rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
Install OpenLiteSpeed Repository
Install OpenLiteSpeed Repository

The above rpm command will update the list of yum repositories that we reference when searching for and installing software packages on the system.

Installing OpenLiteSpeed Web Server

Once we have OpenLiteSpeed repository enabled on the system, we can install the latest version of the OpenLiteSpeed web server by running.

# yum install openlitespeed
Install OpenLiteSpeed in CentOS 8
Install OpenLiteSpeed in CentOS 8

Note: The default OpenLiteSpeed installation directory is /usr/local/lsws.

Installing and Securing MariaDB Database System

Now install the MariaDB database management system by running the following command.

# yum install mariadb-server
Install MariaDB in CentOS 8
Install MariaDB in CentOS 8

Next, start and enable the MariaDB database system so that it automatically starts when our server boots.

# systemctl start mariadb
# systemctl enable mariadb
Start and Enable MariaDB Service
Start and Enable MariaDB Service

Now we can run a simple security script to secure MariaDB installation by setting a new administrative password and locking down some insecure defaults.

# mysql_secure_installation
Secure MariaDB in CentOS 8
Secure MariaDB in CentOS 8

Installing PHP Preprocessor

To install the latest version of PHP 7.x, you need to enable the EPEL repository, which will install PHP 7.3 from OpenLiteSpeed repository with all commonly-used PHP packages that will enough to run the most commonly used web applications.

# yum install epel-release
# yum install lsphp73 lsphp73-common lsphp73-mysqlnd lsphp73-gd lsphp73-process lsphp73-mbstring lsphp73-xml lsphp73-mcrypt lsphp73-pdo lsphp73-imap lsphp73-soap lsphp73-bcmath
# ln -sf /usr/local/lsws/lsphp73/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
Install PHP in CentOS 8
Install PHP in CentOS 8

Change the OpenLiteSpeed Default Admin Password

The default password is set to “123456”, we need to change the default password for OpenLiteSpeed by running the following script.

# /usr/local/lsws/admin/misc/admpass.sh
Change OpenLiteSpeed Admin Password
Change OpenLiteSpeed Admin Password

Optionally, you can set a different username for the administrative account or just hit ENTER to keep the default value of “admin”. Then, set a strong password for the administrative user, which is used to manage OpenLiteSpeed from the web interface.

Testing OpenLiteSpeed Web Page and Admin Interface

The OpenLiteSpeed is already up and running, but if you want to start, stop, restart or verify the status of the server, use the standard service command as shown.

# service lsws status

If you are running a firewall on the system, make sure to open ports 8088 and 7080 on the system.

# firewall-cmd --zone=public --permanent --add-port=8088/tcp
# firewall-cmd --zone=public --permanent --add-port=7080/tcp
# firewall-cmd --reload

Now open your web browser and navigate to the default OpenLiteSpeed’s web page at your server’s domain name or IP address, followed by :8088 port.

http://server_domain_or_IP:8088
OpenLiteSpeed Web Page
OpenLiteSpeed Web Page

Once you are happy with the default OpenLiteSpeed’s web page, you can now access your administrative interface using HTTPS at :7080 port.

https://server_domain_or_IP:7080
OpenLiteSpeed Admin Login
OpenLiteSpeed Admin Login

Once you authenticate, you will be granted with the OpenLiteSpeed administration interface.

OpenLiteSpeed Admin Interface
OpenLiteSpeed Admin Interface

That’s It! In this article, we have explained how to install OpenLiteSpeed with an optimized version of PHP, and MariaDB on a CentOS 8 server. OpenLiteSpeed provides high performance, an easy-to-use admin interface, and pre-configured options for running scripts without any errors.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

4 Comments

Leave a Reply
  1. Hi, it is a great tutorial, but I want to share my experience with it.

    When I using command:

    # yum install openlitespeed
    

    there are error like below:

    [root@myserver ]# yum install openlitespeed
    Last metadata expiration check: 0:01:57 ago on Fri 07 Aug 2020 09:37:16 AM WIB.
    Error:
     Problem: package openlitespeed-1.6.14-3.el8.x86_64 requires lsphp73-mcrypt, but none of the providers can be installed
      - cannot install the best candidate for the job
      - nothing provides libmcrypt.so.4()(64bit) needed by lsphp73-pecl-mcrypt-1.0.3-1.el8.7.3.x86_64
    (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
    

    But it’s can solved by using --nobest, then installation is smooth.

    [root@myserver ]# yum install openlitespeed --nobest
    

    My Question is where is the folder work project (www)?

    Any anwers is much appreciated!

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.