CentOSLinuxTutorials

How To Install OpenLiteSpeed on CentOS 7

Install OpenLiteSpeed on CentOS 7

In this tutorial, we will show you how to install and configuration of OpenLiteSpeed on your CentOS 7.  For those of you who didn’t know, OpenLiteSpeed is an open-source HTTP server developed by LiteSpeed Technologies. OpenLiteSpeed is a high-performance and lightweight HTTP server which comes with a Web Gui administration interface.  As far as Linux web servers are concerned, OpenLiteSpeed has some interesting features that make it a solid choice for many installations. It features Apache compatible rewrite rules, a web administration interface, and customized PHP processing optimized for the server.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation OpenLiteSpeed on a CentOS 7 server.

Prerequisites

  • A server running one of the following operating systems: CentOS 7.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install OpenLiteSpeed on CentOS 7

Step 1. First, add the OpenLitespeed repository to your server.

Use this command to add the repo into your VPS:

rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

Next, you need to enable the EPEL repository on your system:

yum install epel-release

Step 2. Installing OpenLitespeed.

Now install OpenLiteSpeed with this simple yum command:

yum install openlitespeed

Step 3. Installing PHP for OpenLitespeed.

There is a different version of PHP used by OpenLitespeed, PHP versions for openLiteSpeed start with “ls”. Install PHP 7 with many of the extensions to get a rich feature set by typing:

yum install lsphp56 lsphp56-mysql lsphp56-process lsphp56-mbstring lsphp56-mcrypt lsphp56-gd

Now enable PHP 5.6 by simply linking it into the location that OpenLiteSpeed calls when attempting to execute PHP code. Issue command below:

ln -sf /usr/local/lsws/lsphp56/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5

Step 4. Configure the OpenLiteSpeed web server.

OpenLiteSpeed has an Admin Gui for management, so we will configure the admin password for the openLiteSpeed GUI, and then configure PHP 7 to work with openLiteSpeed and open standard HTTP port 80:

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

Step 5. Installing MariaDB on CentOS 7.

MariaDB is a drop-in replacement for MySQL. It is a robust, scalable, and reliable SQL server that comes with a rich set of enhancements. We will also be using yum to install MariaDB:

yum install mariadb mariadb-server mysql

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL:

mysql_secure_installation

To log into MariaDB, use the following command (note that it’s the same command you would use to log into a MySQL database):

mysql -u root -p

To start the database, run the commands below:

systemctl start mariadb
systemctl enable mariadb

Finally, You can give it a test whether OLSWS is running or not:

/usr/local/lsws/bin/lswsctrl start

Step 6. Accessing OpenLiteSpeed.

OpenLiteSpeed will be available on HTTP port 7080 by default. Open your favorite browser and navigate to http://yourdomain.com:7080 or http://server-ip:7080 and complete the required steps to finish the installation. If you are using a firewall, please open port 7080 to enable access to the control panel.

Congratulations! You have successfully installed OpenLiteSpeed. Thanks for using this tutorial for installing the OpenLiteSpeed web server on your CentOS 7 system. For additional help or useful information, we recommend you to check the official OpenLiteSpeed website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button