Nội dung
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:
/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:
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:
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:
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.
However, if your website uses the .htaccess file to work properly, we need to add the following cronjob:
*/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.
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com