Previously, you learned about OpenliteSpeed installation on CentOS 8. OpenLiteSpeed is an open-source, free, lightweight, and high-performance HTTP web server. It is developed by LiteSpeed Technologies. One of its brilliant features is to Apache compatible rewrite rules and optimized PHP processing for the server that can handle thousands of concurrent connections with low CPU and Memory consumption. Join us with the Tutorial Install and configuring OpenLiteSpeed on Debian 10 (buster). If you are looking for a perfect but cheap Linux VPS, Eldernode has provided various VPS packages that could be satisfying. Do not miss 2021 new offers!
To let this tutorial work better, please consider the below Prerequisites:
A non-root user with sudo privileges.
To set up, follow our Initial Setup with Debian 10.
Table of Contents
Install and configure OpenLiteSpeed on Debian 10
OpenLiteSpeed supports many Operating Systems such as Ubuntu, Debian, Mac OS, FreeBSD, and so on. Using OpenLiteSpeed provide you web-based interface, so you will be able to manage web-server from the web browser. It also helps you to create and manage websites easily.
Let’s Get started with updating your packages. Use the command below to do this:
apt-get update -y apt-get upgrade -y
Remember to restart your system when the packages are updated. It results in applying configuration changes. Then, to install the required dependencies, type:
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
How to install OpenLiteSpeed on Debian 10
Debian 10 default repository does not include OpenliteSpeed by default. So, you should install OpenLiteSpeed from the source. Before that, to download the latest version of OpenLiteSpeed, run:
wget https://openlitespeed.org/packages/openlitespeed-1.5.2.tgz
When the download is finished, extract the downloaded file by running the command below:
tar -xvzf openlitespeed-1.5.2.tgz
And then, you must change the directory to the openlitespeed-1.5.2 and install OpenLiteSpeed. So type:
cd openlitespeed-1.5.2 sh install.sh
OpenLiteSpeed should have been installed by now, so you need to configure the administrative password for the web interface. Use the following command to do this:
/usr/local/lsws/admin/misc/admpass.sh
Then, you should create the admin user and password as shown below:
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!
Then, to start the OpenLiteSpeed web service, type:
/etc/init.d/lsws start
In this way, OpenLiteSpeed is now running on port 8088. If you type the URL HTTP://your-server-ip:98088 in your web browser, you should be redirected to the page below:
How to install MariaDB for OpenLiteSpeed
Since MariaDB is available in Debian 10 default repository, use the following command to install it.
apt-get install mariadb-server mariadb-client -y
Then, try to start MariaDB and enable it to start after the system reboot when the installation is finished. So, run:
systemctl start mariadb systemctl enable mariadb
It is time to secure your MariaDB. To do this, run the following script:
mysql_secure_installation
With this script, the root password will be set up, anonymous users will be removed. Also, it disallows root login remotely and removes the test database.
mysql_secure_installation
As you see below, try to answer all the questions.
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
You can safely log in to the MariaDB shell when it is secured. So, run:
mysql -u root
Then, use the command below to disable the plugin authentication.
MariaDB [(none)]>use mysql; MariaDB [(none)]>update user set plugin='' where User='root';
Next, run the command below to flush the privileges and exit from the MariaDB shell.
MariaDB [(none)]>flush privileges; MariaDB [(none)]>exit;
How to install PHP for OpenLiteSpeed
PHP is not available in the OpenLiteSpeed repository by default. So, run the following command to compile PHP from the OpenLiteSpeed web interface. Open your web browser and type the URL HTTP://your-server-ip:7080 to access the OpenLitePanel as below:
Provide your admin user name and password which you have recently created, and click on the Login button. Then, you will view the OpenLiteSpeed dashboard as below:
Next, to see the following page, click on the Tools > Compile PHP.
At this point, you can select the PHP version you want to install and click on the Next button. So, the below page would be displayed:
Now, to start downloading PHP, choose the build options, and click on the Next button. If all goes well, the below page will appear.
By clicking on the Next button, you will see the following page:
You can now log in to your server from the terminal and run the pre-generated script as shown below:
/usr/local/lsws/phpbuild/buildphp_manual_run.sh
The above script will download and compile PHP and related modules to your system. Use the command below to check the installation process.
tail -f /usr/local/lsws/phpbuild/buildphp_1563016683.8.log
When the installation is finished, you would see the output below:
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**
That’s that! Once you see ”Done” it means all is ok and you have successfully passed the required steps.
Conclusion
In this article, we presented the Tutorial Installing and configuring OpenLiteSpeed on Debian 10. From now on, you can host your website using OpenLiteSpeed easily. OpenLiteSpeed is a powerful and modular HTTP server that is able to handle hundreds of thousands of concurrent connections.