How to Install and Configure OpenLiteSpeed Web Server on Debian 10
This tutorial exists for these OS versions
- Debian 11 (Bullseye)
- Debian 10 (Buster)
On this page
OpenLiteSpeed is a free, open-source and lightweight HTTP server developed by LiteSpeed Technologies. OpenLiteSpeed supports many operating systems including, Debian, Ubuntu, Mac OS, FreeBSD and many more. It provides a web-based user interface to manage web server from the web browser. OpenLiteSpeed is used to create and manage websites easily. It is a powerful, modular HTTP server and can able to handle hundreds of thousands of concurrent connections.
In this tutorial, we will show you how to install OpenLiteSpeed on Debian 10 server.
- A server running Debian 10.
- A root password is configured on your server.
First, you will need to update your packages with the latest version. You can update them by running the following command:
apt-get update -y
apt-get upgrade -y
Once your packages are updated, restart your system to apply configuration changes.
Next, install required dependencies with the following command:
apt-get install install build-essential libexpat1-dev libgeoip-dev libpcre3-dev libudns-dev zlib1g-dev libssl-dev libxml2 libxml2-dev rcs libpng-dev libpng-dev openssl autoconf g++ make openssl libssl-dev libcurl4-openssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev libzip-dev
Once all the required dependecies are installed, you can proceed to the next step.
Install and Configure OpenLiteSpeed
By default, OpenLiteSpeed is not available in the Debian 10 default repository. So, you will need to install OpenLiteSpeed from source.
First, download the latest version of OpenLiteSpeed with the following command:
Once the download is completed, extract the downloaded file with the following command:
tar -xvzf openlitespeed-1.5.2.tgz
Next, change the directory to the openlitespeed-1.5.2 and install OpenLiteSpeed with the following command:
After installing OpenLiteSpeed, you will need to configure the administrative password for the web interface. You can do it with the following command:
Create admin user and password as shown below:
Please specify the user name of administrator. This is the user name required to login the administration Web interface. User name [admin]: 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!
Next, start the OpenLiteSpeed web service with the following command:
OpenLiteSpeed is now running and listening on port 8088. Open your web browser and type the URL http://your-server-ip:8088. You will be redirected to the following page:
Install MariaDB for OpenLiteSpeed
By default, MariaDB is available in the Debian 10 default repository. You can install it by just running the following command:
apt-get install mariadb-server mariadb-client -y
Once the MariaDB is installed, start MariaDB and enable it to start after the system reboot with the following command:
systemctl start mariadb
systemctl enable mariadb
Next, you will need to secure your MariaDB installation. You can secure it by running the following script:
This script will setup the root password, Remove anonymous users, Disallow root login remotely and Remove test database.
Answer all the questions as shown below:
Enter current password for root (enter for none): Set root password? [Y/n]: N Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
Once the MariaDB is secured, log in to MariaDB shell with the following command:
mysql -u root
Next, disable the plugin authentication by running the following commands:
MariaDB [(none)]>use mysql;
MariaDB [(none)]>update user set plugin='' where User='root';
Next, flush the privileges and exit from the MariaDB shell with the following command:
MariaDB [(none)]>flush privileges;
Once you have finished, you can proceed to the next step.
Install PHP for OpenLiteSpeed
By default, PHP is not available in the OpenLiteSpeed repository. So, you will need to compile PHP from OpenLiteSpeed web interface.
To access the OpenLiteSpeed admin panel, open your web browser and type the URL http://your-server-ip:7080. You should see the following page:
Now, provide your admin user name and password which you have created earlier and click on the Login button. You should see the OpenLiteSpeed dashboard in the following page:
Now, click on the Tools > Compile PHP, you should see the following page:
Now, select the PHP version you want to install and click on the Next button. You should see the following page:
Now, choose the build options and click on the Next button to start downloading PHP. Once the process completed successfully, you should see the following page:
Next, click on the Next button. You should see the following page:
Now, log in to your server from terminal and run the pre-generated script as shown below:
This script will download and compile PHP and related modules to your system.
You can check the installation process with the following command:
tail -f /usr/local/lsws/phpbuild/buildphp_1563016683.8.log
Once the installation has been completed successfully, you should see the following output:
copy compiled php binary to litespeed directory cd /usr/local/lsws//fcgi-bin ln -sf lsphp-7.3.6 lsphp7 ============================================== Finished building PHP 7.3.6 with LSAPI ============================================== Sat 13 Jul 2019 08:07:36 AM EDT **DONE**
Congratulations! you have successfully installed and configure OpenLiteSpeed on Debian 10 server. You can now easily host your website using OpenLiteSpeed. For more information, you can visit the OpenLiteSpeed official documentation at OpenLiteSpeed Doc