How to install OpenLiteSpeed Web Server on CentOS 7
After an article about installing LiteSpeed, we are gonna show how to install OpenLiteSpeed Web Server on CentOS 7 linux.
Unlike LiteSpeed, OpenLiteSpeed is an open source, high performance and lightweight HTTP web server and have a web interface for administration like LiteSpeed.
Here is our environment:
OS: CentOS 7 linux on VMware
Firewall: firewalld
SElinux: enforcing
IP address: 192.168.147.128
1- Install prerequisites
OpenLiteSpeed needs Mysql(MariaDB) and PHP for web administration interface. so if you do not have these two on your distribution, refer to this article: How to install AMP on CentOS 7 linux
2- Install OpenLiteSpeed
Installing OpenLiteSpeed is easy and straightforward. just we need to add its repository:
# rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
then install OpenLiteSpeed with yum:
# yum install openlitespeed
like LiteSpeed, the default location of OpenLiteSpeed will be /usr/local/lsws.
3- Configure OpenLiteSpeed
3.1 Change default password
because default web administration password is “123456” and this is very weak password, here we change it:
# /usr/local/lsws/admin/misc/admpass.sh
by running above script, you will be asked to enter new password two times.
3.2 Change default port
by default, OpenLiteSpeed listens on port 8088. so we change it to port 80 in config file:
# vim /usr/local/lsws/conf/httpd_config.conf
in above file we search for 8088 in “listener Default” directive and change it to 80.
4- Configure firewall
default port for OpenLiteSpeed http request is 80 and for web administration is 7080. so we need to open these ports in firewall:
# firewall-cmd --permanent --add-service=http # firewall-cmd --permanent --add-port=7080/tcp # firewall-cmd --reload
5- Start service
Now we start OpenLiteSpeed service:
# systemctl start lsws
then refer to server IP address in a browser like Firefox to see default web page:
to enter administration page point to this address: http://server_ip_address:7080