Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:installation:virtualmin [2019/02/04 15:52]
qtwrk
litespeed_wiki:installation:virtualmin [2019/02/04 21:18]
Lisa Clarke Redirect to better URL
Line 1: Line 1:
-===== Generic LiteSpeed WebServer Installation over Apache-based Environment ===== +~~REDIRECT>​litespeed_wiki:​installation:​generic
- +
-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 edit 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 [[https://​www.litespeedtech.com/​products/​litespeed-web-server/​download|download page]] +
- +
-<code>wget https://​www.litespeedtech.com/​packages/​5.0/​lsws-5.3.6-ent-x86_64-linux.tar.gz</​code>​ +
- +
-2. Unpack and install it +
- +
-<​code>​tar xzvf lsws-5.3.6-ent-x86_64-linux.tar.gz +
-cd lsws-5.3.6</​code>​ +
- +
-Input your license key +
- +
-<​code>​echo "​YOUR_LICENSE_KEY"​ > serial.no</​code>​ +
- +
-Alternatively , if this is your first time to use LSWS, you can also try with trial license, download it from [[https://​www.litespeedtech.com/​products/​litespeed-web-server/​download/​get-a-trial-license|here]] and upload it inside lsws folder +
- +
- +
-Now stop Apache before LSWS installation. +
- +
-<​code>​systemctl stop httpd</​code>​ +
- +
- +
-After Apache is stopped, run  +
- +
-<​code>​./​install.sh</​code>​ +
- +
-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: +
- +
-<​code>​Hosting control panel: ​ None +
- +
-User: apache +
- +
-Group : apache +
- +
-HTTP port: 80</​code>​ +
- +
-User/Group must be same as user/group Apache runs ( generally ''​apache:​apache''​ on CentOS, ''​www-data:​www-data''​ on Ubuntu) +
- +
- +
-3. Now install [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​php:​configuring-lsws-for-php|LiteSpeed repository]] for PHP. +
- +
-<​code>​rpm -Uvh http://​rpms.litespeedtech.com/​centos/​litespeed-repo-1.1-1.el7.noarch.rpm</​code>​ +
-  +
- +
-install the PHP version you need , in this guide we will use PHP 7.0 as example. +
- +
-<​code>​yum install lsphp70*</​code>​ +
- +
-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 +
- +
-<​code>/​usr/​local/​lsws/​admin/​misc/​admpass.sh</​code>​ +
- +
- +
-Go to configuration,​ server, section "Using Apache Configuration File" and "HT Access"​ , set up like screenshot +
- +
-{{:litespeed_wiki:​installation:​virtualmin1.jpg|}} +
- +
-{{:​litespeed_wiki:​installation:​virtualmin2.jpg|}} +
- +
-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 +
- +
-<​code><​IfModule Litespeed>​ +
-AddHandler application/​x-httpd-phpXX .php +
-</​IfModule></​code>​ +
- +
-replace XX to the PHP version you installed. +
- +
-6. Access a test page to check the result. +
- +
-{{:​litespeed_wiki:​installation:​virtualmin3.jpg|}} +
- +
-As you can see it shows ''​Server API LiteSpeed V7.2''​ +
- +
- +
- +
-===== How To Change PHP Version ? ===== +
- +
-install the PHP version you need , for example  +
- +
-<​code>​yum install lsphp73*</​code>​  +
- +
-Restart LSWS so it can detects new PHP versoin, and add following content to **.htaccess** +
- +
-<​code><​IfModule Litespeed>​ +
-AddHandler application/​x-httpd-php73 .php +
-</​IfModule></​code>​ +
- +
-Check phpinfo you will see it's php7.3 now +
- +
-{{:​litespeed_wiki:​installation:​virtualmin4.jpg|}} +
- +
-so is same for other PHP version. +
- +
- +
-{{:​litespeed_wiki:​installation:​virtualmin5.jpg|}} +
- +
- +
-===== How To Compile PHP Extension? ===== +
- +
-For example we want compile PHP exntesion: **timezonedb** for PHP 7.3 +
- +
-Install dependencies. +
- +
-<​code>​yum install -y lsphp73-devel make gcc glibc-devel</​code>​ +
- +
-Compile it. +
- +
-<​code>/​usr/​local/​lsws/​lsphp73/​bin/​pecl install timezonedb</​code>​ +
- +
- +
-Add it into configuration file. +
- +
-<​code>​echo "​extension=timezonedb.so"​ > /​usr/​local/​lsws/​lsphp73/​etc/​php.d/​20-timezone.ini</​code>​ +
- +
- +
-Since LSWS 5.3 as PHP default runs in deatach mode , you may need to kill current **lsphp** process to have new configuration loaded. +
- +
-{{:​litespeed_wiki:​installation:​virtualmin6.jpg|}} +
- +
-===== How To Switch Back To Apache? ===== +
- +
-Stop LSWS to release 80/443 port +
- +
-<​code>/​usr/​local/​lsws/​bin/​lswsctrl stop</​code>​ +
- +
- +
-And then start Apache again. +
- +
-<​code>​systemctl start httpd</​code>​ +
- +
- +
-{{:​litespeed_wiki:​installation:​virtualmin7.jpg|}} +
- +
-As you can see the Server API is changed to CGI/​FastCGI. +
- +
  • Admin
  • Last modified: 2019/02/04 21:19
  • by Lisa Clarke