How to Install OpenLiteSpeed on Centos 7

OpenLiteSpeed (OLS) is one of the fastest web servers available in the market today. Here, we’ll show you how to install OLS from its repository in Centos7.6, configure PHP and make OLS use port 80 by default.

1. Add the OLS repository to your computer

[[email protected] ~]$ sudo rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

2. Install OLS

[[email protected] ~]$ sudo yum install openlitespeed

By default, OLS is installed under /usr/local/lsws

You can then start OLS by running either of the commands below

[[email protected] ~]$ sudo /usr/local/lsws/bin/lswsctrl start

or

[[email protected] ~]$ sudo systemctl start lsws

3. Add needed repositories for PHP

For EPEL, run:

[[email protected] ~]$ sudo yum install epel-release

For OLS repo, run

[[email protected] ~]$ sudo rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

4. Now install PHP. The command below installs php 7.3. You can replace the numbers 73 with any other version you want, e.g. 72 for php7.2 etc

[[email protected] ~]$ sudo yum install lsphp73 lsphp73-common lsphp73-mysql lsphp73-gd lsphp73-process lsphp73-mbstring lsphp73-xml lsphp73-mcrypt lsphp73-pdo lsphp73-imap lsphp73-soap lsphp73-bcmath

If you want to install various versions of PHP, you can use the command below:

[[email protected] ~]$ sudo yum groupinstall lsphp-all

Now, you are all set to run a PHP based application on OLS. By default, OLS uses port 8088 for http traffic. For the web admin interface, it uses port 7080. We will leave the web admin interface intact and change the http port to the default port 80 everyone is used to. To do this, follow the steps below.

5. On your browser, login to the web admin. If your are your local machine, use https://localhost:7080 then login using username admin and password as 123456. If you are using a server with a public ip, use https://[IP_ADDRESS]:7080

6. On your left pane, navigate to Listeners. Under Summary tab, click on the View button (the one that looks like a magnifying glass).

7. Under General tab, click the Edit icon on your top right.

8. Change the Port from 8088 to 80 then click the Save icon.

Leave a Reply

Your email address will not be published.