Home DirectAdmin How to install OpenLiteSpeed on DirectAdmin

How to install OpenLiteSpeed on DirectAdmin

by Thạch Phạm

Overview of OpenLiteSpeed DirectAdmin

OpenLiteSpeed is the free and open-source version of the LiteSpeed Web Server Enterprise edition. OpenLiteSpeed contains most of the essential features in LiteSpeed Enterprise, including LSCache (a necessary plugin for WordPress).

You can see a comparison between OpenLiteSpeed and LiteSpeed Enterprise in the following article:

System requirements before installing OpenLiteSpeed DirectAdmin

1. DirectAdmin version required

To install OpenLiteSpeed on DirectAdmin, you need to use at least DirectAdmin version 1.57 or higher.

To check the DirectAdmin version, you can check in 2 methods:

Method 1: Through SSH

You need to SSH into your VPS/server. You can refer to the following guide if you do not know how to SSH:

After SSH into the VPS/Server, we use the following command to check the DirectAdmin version in use:

AZDIGI Tutorial
/usr/local/directadmin/directadmin v
    

My VPS is using version 1.61.3, it is completely possible to install OpenLiteSpeed DirectAdmin.

Method 2: Through the DirectAdmin interface

You can also check the DirectAdmin version through the DirectAdmin panel admin page.

First, go to System Info & Files => System Information, scroll down to see what version is being used.

What about pre-release (beta) versions of DirectAdmin?

OpenLiteSpeed also works well on pre-release versions of DirectAdmin. If you are interested, you can install the pre-release version of DirectAdmin according to the following official instructions, but because it is a pre-release version, it will definitely be less stable than the official version:

However, if you are using a DirectAdmin version lower than 1.57, you can upgrade to a newer version by following these instructions:

  • DirectAdmin version upgrade

2. Requires CustomBuild 2.0

In addition to the DirectAdmin version requirement greater than 1.57, another requirement is that the CustomBuild version must be 2.0.

To check the CustomBuild version we need to SSH into your VPS/Server and use these two commands:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build version
    

Below is my result:

If your CustomBuild version is lower than 2.0, you can refer to the following tutorial to upgrade CustomBuild 1.x to 2.0:

After satisfying the above two conditions, we proceed to install OpenLiteSpeed on DirectAdmin.

Install OpenLiteSpeed on DirectAdmin

To install OpenLiteSpeed DirectAdmin, we use the following commands in order:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build update
./build set webserver openlitespeed
./build set mod_ruid2 no
./build set php1_mode lsphp
./build set php2_mode lsphp
./build set php3_mode lsphp
./build set php4_mode lsphp
./build openlitespeed
./build php n
./build rewrite_confs
    

Explanation of the above commands:

  • cd /usr/local/directadmin/custombuild: Move into the directory custombuild
  • ./build update: Update CustomBuild script.
  • ./build set webserver openlitespeed: Change the OpenLiteSpeed webserver configuration.
  • ./build set mod_ruid2 no: Disable mod_ruid2 because mod_ruid2 only works with Apache.
  • ./build set php1_mode lsphp: Set PHP1 version mode to lsphp.
  • ./build set php2_mode lsphp: Set PHP2 version mode to lsphp.
  • ./build set php3_mode lsphp: Set PHP3 version mode to lsphp.
  • ./build set php4_mode lsphp: Set PHP4 version mode to lsphp.
  • ./build openlitespeed: Start replacing the existing webservice with OpenLiteSpeed.
  • ./build php n: Reinstall the entire PHP version to be compatible with OpenLiteSpeed.
  • ./build rewrite_confs: Rewrite your custom configuration, if you want everything default to skip this command.

Below is an image of the order when executing the above commands and annotating each image:

Change default Apache webservice to OpenLiteSpeed DirectAdmin.
Change Apache default webservice settings to OpenLiteSpeed.
Disable mod_ruid2 because mod_ruid2 only works with Apache.
OpenLiteSpeed DirectAdmin
Change the PHP1 version mode to lsphp.
Change the PHP2 version mode to lsphp.
Change the PHP3 version mode to lsphp.
Change the PHP4 version mode to lsphp.
OpenLiteSpeed DirectAdmin
The process of replacing the existing webservice with OpenLiteSpeed is now complete. And you get OpenLiteSpeed dashboard admin information, remember to save this information. The default port of the OpenLiteSpeed control panel is 7080, you need to open the IN/OUT port on your firewall.
OpenLiteSpeed DirectAdmin
Running the ./build php n command will take up quite a bit of your time. If you use multiple versions of PHP, the time will be longer, I only run a version of PHP 7.3.
OpenLiteSpeed DirectAdmin
The last step is to rewrite your custom configuration, if you want everything to default, skip this command.

So we have completed the process of changing the webservice to OpenLiteSpeed. Let’s take a look at the OpenLiteSpeed admin interface.

We will see OpenLiteSpeed in the System Information section.

OpenLiteSpeed DirectAdmin

However, if your website uses the .htaccess file to work properly, we need to add the following cronjob:

AZDIGI Tutorial
*/3 * * * * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi
    

OpenLiteSpeed reads .htaccess at service start time. So, if some .htaccess files are newly created or existing files are modified, the changes will not take effect until the OpenLiteSpeed service reloads.

So we will reload OpenLiteSpeed every 3 minutes if the system detects new .htaccess files or changes the content of old .htaccess files.

Summary

So this article has shown how to install OpenLiteSpeed on DirectAdmin. If you find the article useful, don’t forget to rate 5 stars.

Wishing you success.

Đánh giá

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign