Installing OpenLiteSpeed on DirectAdmin

I recently switched to OpenLiteSpeed server on my DirectAdmin (hosting this very blog!) and wanted to share the simple installation process and tweaking the total workers available! By default, DirectAdmin ships with stock Apache. In most cases, stock Apache will work, however, OpenLiteSpeed is a good alternative for your infrastructure! I won’t spend any time providing you a 1-1 comparison, however, there are good comparisons on LiteSpeed’s website.

In order to get started installing OpenLiteSpeed, you’ll want to ssh into your DirectAdmin server as root and run the following commands:

cd /usr/local/directadmin/custombuild # change to custombuild directory
./build update
./build set webserver openlitespeed
./build set mod_ruid2 no
./build set php1_mode lsphp # do this for every PHP instance you have (eg, php2_mode, php3_mode, php4_mode, etc)
./build openlitespeed
./build php n
./build rewrite_confs

Throughout the installation process, you’ll see a new service running on port 7080. This is the OpenLiteSpeed interface with graphs and informations, the credentials should be outputted during the installation process. When you visit that page, you should be greeted with a login screen that looks similar to this:

OpenLiteSpeed dashboard login screen

Inside you’ll find various configuration information, traffic graphs that can be very useful for statistics. In my case, I have lots of resources to throw at DirectAdmin, OpenLiteSpeed (32 GB Memory, E5v2 CPU dedicated to this machine). In this case, I want to up the workers from the default 2 to 8 (maximum is 16). It took me a bit of searching because you can’t simply update it in the web admin panel, you have to do it directly in a file and reload openlitespeed!

In order to edit these settings, DirectAdmin places the configuration in /usr/local/lsws/conf/httpd-defaults.conf. This file defines all of our worker information. Upon editing this file, the first line is httpdWorkers, in this case I’ll increase this from 2 to 8 and save the file. Then execute systemctl restart openlitespeed and the changes will be applied!

Reloading the admin panel under configuration in OpenLiteSpeed will show the number of workers increased from 2 to 8. In my case, I’ve found a noticeable speed improvement when there is more than two workers.

That’s how to enable OpenLiteSpeed and it’s very simple to do! All my sites (blog, business) and families now benefit from OpenLiteSpeed and LSCache. For WordPress blogs like mine, I installed the LiteSpeed LSCache plugin, and tweaked the settings on it. If you view the page source, you should see the litespeed injecting itself in as a comment at the end of the page source. All-in-all, I’m quite impressed by the performance and stability of the entire platform, and I can’t wait to keep iterating and make it better!