Starting with CustomBuild 2.0 RC7, DirectAdmin's CustomBuild 2.0 supports integration with LiteSpeed Web Server. This wiki will guide you through the steps for installing LSWS on a server using DirectAdmin with CustomBuild 2.0.
This wiki assumes that you already have a working server using DirectAdmin (version 1.45.2 and up), CustomBuild 2.0, and Apache.
Using the command line, LSWS can be installed with the following commands:
cd /usr/local/directadmin/custombuild ./build update ./build set webserver litespeed ./build set php1_mode lsphp ./build set php2_mode lsphp ./build set php3_mode lsphp ./build set php4_mode lsphp ./build litespeed ./build php n
The commands above install LSWS with a trial license and build PHP for LSWS.
Now that LSWS is installed, follow the steps in the wiki on activating licenses to switch from the trial license to a purchased license.
Notes:
admin
, the password will be randomly generated. The password appears at the end of the installation:The CustomBuild Plugin is a GUI addition to CustomBuild. Use the following steps to install LSWS through the CustomBuild Plugin:
In the Edit Options
tab, change the php1_mode
setting to lsphp
.
Then change the webserver
setting to litespeed
.
Save your settings by clicking the Save
button at the bottom of the page.
Go to the Build Software
tab. First, build LSWS.
Note: If you do not have an existing installation of LSWS, CustomBuild will assign you a username and password for the LSWS WebAdmin console. The username is admin
, the password will be randomly generated. The password appears at the end of the installation:
Then build PHP.
You can then go into DirectAdmin's Service Manager to check that LSWS is running.
Notes:
Now that CustomBuild 2.0 has LSWS integration, some of the LiteSpeed DirectAdmin Plugin's functions are now redundant. We will be updating the Plugin to include only functionality not covered by CustomBuild 2.0.
CustomBuild does not provide a hot switch between web servers. Each time you switch servers, you will need to recompile PHP again. You can run a series of commands through CustomBuild 2.0 to make this happen or you can run the following script to switch web servers and recompile PHP.
/usr/local/lsws/admin/misc/cp_switch_ws.sh lsws(or apache)
DirectAdmin will be adding a hot switch feature in the near future.
For Custombuild2 PHP1_release=5.6, PHP2_release=7.1 as example.
Login as user level → click domain settings and you will see:
Note:
su - USER_ACCOUNT -s /bin/bash
php -v
Then you should see the version you choose from Select PHP version
1. ./build: line 968: 14423 Killed ${INITDDIR}/${SERVICE_NAME} ${SERVICE_ACTION}. Installation of LiteSpeed 5.0.16 is now complete.
Your server IP has used a trial license before and it has expired. You should purchase a license or log a ticket with us to ask for a trial extension. Please copy your serial number file to /usr/local/lsws/conf/
or download a new trial key.
2. MIME type [application/x-httpd-php55] for suffix '.php' does not allow serving as static file, access denied!
A ''.php55'' suffix should be created to be associated with php external apps, for example, lsphp5. This can be done through the WebAdmin console or ''vi /usr/local/lsws/conf/httpd_config.xml'' by adding the following to inside of the ''<scriptHandlerList> </scriptHandlerList>'' block: <scriptHandler> <suffix>php55</suffix> <type>lsapi</type> <handler>lsphp5</handler> <note></note> </scriptHandler>
3. PHP1/2 select not working
grep php1 /usr/local/directadmin/custombuild/options.conf
/usr/local/directadmin/data/users/USER_ACCOUNT/httpd.conf