This is an old revision of the document!


This generic guide for how to install LSWS on any Apache-based environment, please do not directly perform this on production server , it is highly recommended to run though test first.

And depends on your environment, this may disable some panel feature, most likely the PHP-related feature as this set will have its own LSPHP.

This guide is made and test on CentOS 7.X, please change commands/values to equivalent of your system.

1. Download the package from download page

wget https://www.litespeedtech.com/packages/5.0/lsws-5.3.6-ent-x86_64-linux.tar.gz

2. Unpack and install it

tar xzvf lsws-5.3.6-ent-x86_64-linux.tar.gz
cd lsws-5.3.6

Input your license key

echo "YOUR_LICENSE_KEY" > serial.no

Alternatively , if this is your first time to use LSWS, you can also try with trial license, download it from here and upload it inside lsws folder

Now stop Apache before LSWS installation.

systemctl stop httpd

After Apache is stopped, run

./install.sh

to install LSWS, during the installation there are several options need to be configured, most options can be left as default , only following need to be set:

Hosting control panel:  None

User: apache

Group : apache

HTTP port: 80

User/Group must be same as user/group Apache runs ( generally apache:apache on CentOS, www-data:www-data on Ubuntu)

3. Now install LiteSpeed repository for PHP.

rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

install the PHP version you need , in this guide we will use PHP 7.0 as example.

yum install lsphp70*

4. once LSWS and LSPHP are installed , now login to webadmin console by accessing URL: https://YOUR_SERVER_IP:7080 , if you can not access please check if your firewall is blocking it.

Use the username and password you were asked to set during install script , if you need to reset it , please run

/usr/local/lsws/admin/misc/admpass.sh

Go to configuration, server, section “Using Apache Configuration File” and “HT Access” , set up like screenshot

You can use which httpd to locate Apache binary path, Apache configuration are generally located on /etc/httpd or /etc/apache2.

Note: PHP suEXEC Max Conn controls how many concurrent PHP process can a single site can have.

Now restart LSWS to take effect.

5. Add content to .htaccess

<IfModule Litespeed>
AddHandler application/x-httpd-phpXX .php
</IfModule>

replace XX to the PHP version you installed.

6. Access a test page to check the result.

As you can see it shows Server API LiteSpeed V7.2

install the PHP version you need , for example

yum install lsphp73*

Restart LSWS so it can detects new PHP versoin, and add following content to .htaccess

<IfModule Litespeed>
AddHandler application/x-httpd-php73 .php
</IfModule>

Check phpinfo you will see it's php7.3 now

so is same for other PHP version.

For example we want compile PHP exntesion: timezonedb for PHP 7.3

Install dependencies.

yum install -y lsphp73-devel make gcc glibc-devel

Compile it.

/usr/local/lsws/lsphp73/bin/pecl install timezonedb

Add it into configuration file.

echo "extension=timezonedb.so" > /usr/local/lsws/lsphp73/etc/php.d/20-timezone.ini

Since LSWS 5.3 as PHP default runs in deatach mode , you may need to kill current lsphp process to have new configuration loaded.

Stop LSWS to release 80/443 port

/usr/local/lsws/bin/lswsctrl stop

And then start Apache again.

systemctl start httpd

As you can see the Server API is changed to CGI/FastCGI.

  • Admin
  • Last modified: 2019/02/04 16:03
  • by qtwrk