In this tutorial we are going to provide you with step-by-step instructions on how to install OpenLiteSpeed on a CentOS 7 Virtual Server. OpenLiteSpeed is a high performance web server software. It is a lightweight application with low CPU and RAM usage, developed by LiteSpeed Technologies. It is fairly easy to Install OpenLiteSpeed on a CentOS server. The installation process should take about 10-15 minutes if you follow the easy steps described below.
Update OS packages
Before going through the installation process, make sure your package list and the OS packages are up to date by running the following commands:
yum clean all yum update
If there is a web server alredy installed on your server, stop it and remove it:
ps aux | grep httpd || nginx
If, for example, you have Apache installed on your server, stop it, disable it to automatically start on boot, and remove it:
systemctl stop httpd systemctl disable httpd yum remove httpd
Install OpenLiteSpeed
To install the latest OpenLiteSpeed version from the official OpenLiteSpeed repository, run the following commands:
rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm yum install openlitespeed
Install Epel repository, then install PHP 7 packages for OpenLiteSpeed:
yum install epel-release yum install lsphp70 lsphp70-common lsphp70-json lsphp70-imap lsphp70-mbstring lsphp70-mcrypt lsphp70-mysqlnd lsphp70-process lsphp70-gd lsphp70-opcache lsphp70-soap lsphp70-bcmath lsphp70-pdo lsphp70-xml
OpenLiteSpeed is an open source web server which comes with a web-based GUI administration interface. The the default administration password for OpenLiteSpeed is set to ‘123456’, so change the admin password for the OpenLiteSpeed GUI using the following command:
/usr/local/lsws/admin/misc/admpass.sh
Make sure to use strong passwords for your OpenLiteSpeed admin password. Generally, a password utilizing at least 10 characters including alphanumeric and grammatical symbols is sufficient. Never use passwords based upon dictionary words or significant dates.
OpenLiteSpeed is listening port 7080 by default, so open your favorite browser and go to http://server_IP:7080/
Also, configure OpenLiteSpeed to listen on Port 80:
Open your favorite browser and go to http://server_IP:7080/ >> Listeners >> click on ‘View’ icon from the Actions section >> click on ‘Edit’ icon next to Address Settings >> change port 8088 to port 80 and click on ‘Save’ icon.
Create a new virtual host in OpenLiteSpeed:
Run the following commands:
cd /usr/local/lsws mkdir -p yourdomain mkdir -p yourdomain/{conf,html,logs} rsync -Waq /usr/local/lsws/Example/html/ /usr/local/lsws/yourdomain/html/
Go to the OpenLiteSpeed WebAdmin console at https://server_IP:7080 >> Virtual Hosts >> click on ‘View’ icon from the ‘Actions’ section >> Click on ‘Edit’ icon next to ‘Base’ section and add a new virtual host to OpenLiteSpeed:
Virtual Host Name: yourdomain Virtual Host Root: $SERVER_ROOT/yourdomain/ Config File: $SERVER_ROOT/conf/vhosts/yourdomain/vhconf.conf
Click on ‘Save’ icon.
Click on ‘Virtual Hosts’ link from the OpenLiteSpeed WebAdmin console >> click on ‘yourdomain’ link >> General >> click on ‘Edit’ icon, enter ‘/usr/local/lsws/yourdomain/html’ in the ‘Document root’ field and your domain name in the ‘Domain Name’ field and click on ‘Save’ icon.
Restart OpenLiteSpeed server for the changes to take effect by clicking on ‘Graceful Restart’ button available from the top-left menu above the Dashboard link and click ‘yes’ to confirm.
That is it. The OpenLiteSpeed configuration is now complete on your virtual private server.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.