Introduction
OpenLiteSpeed is a lightweight, high performing open source web server developed, copyrighted and maintained by LiteSpeed Technologies. It has a remarkable web-based GUI for administration.
It runs fewer processes, easily handles thousands of concurrent connections on low resource usage i.e. RAM and CPU, highly scalable – runs so many virtual hosts i.e. hosts many different websites on one web server, has less overhead and highly optimized to run all kinds of scripts e.g. PHP, Java, Ruby, Perl, e.t.c. In regards to WordPress platform, it’s mostly used in the LiteSpeed Cache for WordPress plugin which accelerates WordPress hosting platform.
LiteSpeed is available as the free open source OpenLiteSpeed and the paid LiteSpeed Enterprise. OpenLiteSpeed contains all essential features if the Enterprise.
In this article, we illustrate how to install OpenLiteSpeed Web Server on Centos 7 Linux VPS.
Pre-requisites
- Fresh Install Centos 7
- Basic understanding of Linux commands
- A non-root user with sudo privileges
Update the system packages
$ sudo yum update -y
Install OpenLiteSpeed dependencies
$ sudo yum install gcc gcc-c++ make autoconf glibc rcs automake libtool -y $ sudo yum install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel udns-devel -y
Install OpenLiteSpeed
There are 3 ways of installing OpenLiteSpeed.
- Install from source code
- Install from LiteSpeed Repo
- Install from script
In this demonstration, we shall install from source code to ensure we install the latest version of Litespeed (at the time of the publication it’s 1.4.35).
Visit OpenLiteSpeed Downloads Page and download the Current Stable Edition 1.4.35 as follows:
$ wget https://openlitespeed.org/packages/openlitespeed-1.4.35.tgz
Special Note: Incase wget is not installed, you can install using command:
$ sudo yum install wget
Unpack/Decompress the downloaded file.
$ tar -xzvf openlitespeed-1.4.35.tgz
Change into the installation directory, compile and install the package with sudo privileges or as the root user.
$ cd openlitespeed-1.4.35/ $ sudo ./configure $ sudo make && sudo make install
OpenLiteSpeed will be automatically installed in /usr/local/lsws
directory.
Configure OpenLiteSpeed
Configure the administrative password for OpenLiteSpeed web server.
[linuxuser@centos7-litespeed ~]$ sudo /usr/local/lsws/admin/misc/admpass.sh Please specify the user name of administrator. This is the user name required to login the administration Web interface. User name [admin]: litecentos-admin Please specify the administrator's password. This is the password required to login the administration Web interface. Password: Retype password: Administrator's username/password is updated successfully!
Start OpenLiteSpeed web server
$ sudo /etc/init.d/lsws start
OR
$ sudo /usr/local/lsws/bin/lswsctrl start
Access Web Server
By default, OpenLiteSpeed web server will be available on HTTP Port 8088 while the administrative WebAdmin console will be available on Port 7080. If you have firewall firewalld enabled, you need to open the respective ports for access.
Configure Firewall for Port Access
Add the firewall rules
$ sudo firewall-cmd --permanent --zone=trusted --add-service=http $ sudo firewall-cmd --permanent --zone=trusted --add-service=https $ sudo firewall-cmd --permanent --zone=public --add-port=8088/tcp $ sudo firewall-cmd --permanent --zone=public --add-port=7080/tcp
Reload firewalld to effect the changes
$ sudo firewall-cmd --reload
To confirm that the ports have been opened on the firewall, list everything added or enabled on the zone.
[linuxuser@centos7-litespeed ~]$ sudo firewall-cmd --list-all public (active) target: ACCEPT icmp-block-inversion: no interfaces: eth0 sources: services: http https ports: 7080/tcp 8088/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
Once the firewall has given access to those two ports, then you can access the web server.
Go to http://your-domain.com:8088 or http://server-ipaddress:8088
In our case, it’s http://35.226.114.205:8088/ as shown below
For the Webadmin Console
Go to https://your-domain.com:7080 or https://server-ipaddress:7080
In our case it’s https://35.226.114.205:7080/ as shown below
At first, you’ll get “Your connection is not secure” error since the browser does not recognize the site’s ssl certificate as it was automatically generated and self-signed by the Linux server during the web server installation.
Ignore that error and Click Advanced, then Click Add Exception as shown below:
“Add Security Exception” Tab pops up. Click Confirm Security Exception
Finally, the login page appears as shown below: