Differences

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

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:installation:standalone-apache-migration [2015/07/20 19:34]
Michael Alegre created
litespeed_wiki:installation:standalone-apache-migration [2019/05/24 16:46] (current)
Kacey Schroeder [Step 4: Test and switch to LiteSpeed]
Line 1: Line 1:
 ====== How to Convert Standalone Apache to LiteSpeed ====== ====== How to Convert Standalone Apache to LiteSpeed ======
  
-This wiki covers how to set up LSWS (either Enterprise or Standard [[litespeed_wiki:​license:​what_license_to_choose|editions]]) ​on a server that already has a working Apache installation but no control panel.+This wiki covers how to set up LSWS on a server that already has a working Apache installation but no control panel.
  
  
Line 10: Line 10:
 Download LSWS tarball from the [[http://​www.litespeedtech.com/​download/​litespeed-web-server-download|LiteSpeed Technologies website]]. Download LSWS tarball from the [[http://​www.litespeedtech.com/​download/​litespeed-web-server-download|LiteSpeed Technologies website]].
  
-Run the following commands from ssh as root+Run the following commands from SSH as root
  
   cd /root   cd /root
-  wget http://​www.litespeedtech.com/​packages/​4.0/lsws-4.2.12-ent-x86_64-linux.tar.gz+  wget http://​www.litespeedtech.com/​packages/​5.0/lsws-5.3.8-ent-x86_64-linux.tar.gz
  
-**Note:** Replace the values in the URL to control for your OS and which version/​[[litespeed_wiki:​license:what_license_to_choose|edition]] of LSWS you wish to download:+**Note:** Replace the values in the URL to control for your OS and which version/​[[litespeed_wiki:​licenses:choosing-a-license|edition]] of LSWS you wish to download:
  
-''​lsws-4.2.12-ent-x86_64-linux''​ = LSWS Enterprise ​4.2.12 for 64bit Linux+''​lsws-5.3.8-ent-x86_64-linux''​ = LSWS Enterprise ​5.3.for 64bit Linux
  
-''​lsws-4.2.10-std-i386-linux''​ = LSWS Standard ​4.2.10 for 32bit Linux+''​lsws-5.3.8-std-i386-linux''​ = LSWS Standard ​5.3.for 32bit Linux
  
-''​lsws-4.2.12-ent-x86_64-freebsd6''​ = LSWS Enterprise ​4.2.12 for 64bit FreeBSD 6.x+''​lsws-5.3.8-ent-x86_64-freebsd6''​ = LSWS Enterprise ​5.3.for 64bit FreeBSD 6.x
  
 ==== 1.2 Unpack ==== ==== 1.2 Unpack ====
  
-  tar zxfv  lsws-4.2.12-ent-x86_64-linux.tar.gz+  tar zxfv  lsws-5.3.8-ent-x86_64-linux.tar.gz
  
 ==== 1.3 Run the installation script ==== ==== 1.3 Run the installation script ====
  
-For Enterprise Edition, make sure to put the license file (trial.key or paid license serial.no file in the unpacked folder).+For Enterprise Edition, make sure to put the license file (trial.key or paid license serial.no filein the unpacked folder.
  
-  cd lsws-4.2.12+  cd lsws-5.3.8
   ./​install.sh   ./​install.sh
  
Line 43: Line 43:
 ===== Step 2: Install PHP ===== ===== Step 2: Install PHP =====
  
-Two options for setting up PHP for LiteSpeed:​ +Enable the LiteSpeed repository and download LSPHP from our repository. See [[litespeed_wiki:​php:​rpm#​installing_php_from_the_litespeed_repository|instructions]] here.You may have default php.ini file installed through RPMs and You just need to make some changes to match it to exiting Apache PHP. Check both phpinfo pages for difference.
- +
-  - Enable the LiteSpeed repository and download LSPHP from our repository. See [[litespeed_wiki:​php:​rpm#​installing_php_from_the_litespeed_repository|instructions]] here.You may have default php.ini file installed through RPMs and You just need to make some changes to match it to exiting Apache PHP. Check both phpinfo pages for difference.  +
-  - If you are not using CentOS or you need PHP packages that are not included in our repository, you can build your own PHP [[litespeed_wiki:​php:​lsapi#​compiling_php_through_wedadmin_console|from LiteSpeed Web Admin Console]] or [[/​litespeed_wiki:​php:​lsapi#​compiling_php_from_source_code|from PHP source code]]. See [[litespeed_wiki:​apache:​migration:​buildphp|more PHP compiling options and instructions]] here. You may need to create your own php.ini file for your compiled binary. It can be copied from your exiting Apache PHP configuration or from PHP source code package php.ini-production file. For example for Debain Apache2, you may run: +
-    +
-<​code>​cp /​etc/​php5/​apache2/​php.ini /​usr/​local/​lsws/​lsphp5/​lib/​php.ini </​code>​ +
- +
-Of course, Apache php.ini location or LSPHP installation prefix may be different. You can easily change it accordingly+
 ===== Step 3: Load Apache Configuration in LSWS ===== ===== Step 3: Load Apache Configuration in LSWS =====
-Open LiteSpeed ​Web admin console, under "​server"​→"​General" tab, change configurations in "Using Apache Configuration File" ​table.+Open the LiteSpeed ​WebAdmin Console and, under **Configuration > Server > General**, change configurations in **Using Apache Configuration File** table.
 <​code>​ <​code>​
 Load Apache Configuration => Yes Load Apache Configuration => Yes
Line 64: Line 57:
  
 **Note:​** ​ **Note:​** ​
-  * "PHP suEXEC Max Conn" ​can be adjusted based how many and how big the sites has been hosted. For a server dedicated for a large Wordpress or vBulletin site, you can safely increase it to "10""15" ​or "20", try different value and see what is the best for you.+  * **PHP suEXEC Max Conn** can be adjusted based how many and how big the sites has been hosted. For a server dedicated for a large Wordpress or vBulletin site, you can safely increase it to ''​10''​''​15'', ​or ''​20''​, try different value and see what is the best for you.
   * Different system/​platform,​ default Apache Configuration File is different. For example, for CentOS, it is located at /​etc/​httpd/​conf/​httpd.conf;​ for WHM/cPanel, it is /​usr/​local/​apache/​conf/​httpd.conf;​ for Debian Apache2, it is /​etc/​apache2/​apache2.conf. ​   * Different system/​platform,​ default Apache Configuration File is different. For example, for CentOS, it is located at /​etc/​httpd/​conf/​httpd.conf;​ for WHM/cPanel, it is /​usr/​local/​apache/​conf/​httpd.conf;​ for Debian Apache2, it is /​etc/​apache2/​apache2.conf. ​
 +  * We set ''​Apache Port Offset => 2000''​ in this example but most of the time, you cannot test other ports since application backend URL with port has been set to 80 or 443, such as WordPress. In this case, you should set ''​Apache Port Offset => 0''​ and make sure to stop apache before starting LSWS for testing. You can not run both Apache and LiteSpeed at the same time when ''​Apache Port Offset => 0''​ .
  
 Sometimes your Apache conf file may have environment parameters set in /​etc/​apache2/​envvars or other locations, such as: Sometimes your Apache conf file may have environment parameters set in /​etc/​apache2/​envvars or other locations, such as:
Line 95: Line 89:
 Most of the time, LSWS loads your Apache configuration straight away without any error. Most of the time, LSWS loads your Apache configuration straight away without any error.
 ===== Step 4: Test and switch to LiteSpeed ​ ===== ===== Step 4: Test and switch to LiteSpeed ​ =====
 +If your application doesn'​t allow you to run offset port for LSWS, such as WordPress, Magento,​etc,​ you should stop Apache webserver and start LSWS for testing.
  
-Restart ​LSWS and try web sites hosted on port 2080 and secured sites on 2443. Most of the time your website ​are running smoothly and very faster already.+If your application allowed, you can set port offset such as ''​2000''​ then start LSWS and try websites ​hosted on offset ​port 2080 and secured sites on port 2443. This way you may run both Apache (port 80 or 443) and LiteSpeed (port 2080 or 2443) at the same time.  ​Most of the time your website ​is running smoothly and very faster already.
  
 If there is any problem, probably a PHP issue, you need to check LSWS error log, LSWS stderr log or PHP errors log for details. Server error log and stderr log are set to the following location by default unless you customize it.  If there is any problem, probably a PHP issue, you need to check LSWS error log, LSWS stderr log or PHP errors log for details. Server error log and stderr log are set to the following location by default unless you customize it. 
Line 103: Line 98:
   /​usr/​local/​lsws/​logs/​stderr.log   /​usr/​local/​lsws/​logs/​stderr.log
   ​   ​
-For PHP error logs, they are normally located ​at the directory where PHP script runs:+For PHP error logs, they are normally located ​in the directory where PHP script runs:
  
 You may go to your server document root and find them: You may go to your server document root and find them:
   find . -name php_errors.log   find . -name php_errors.log
  
-You should check the php_errors.log for corresponding location where the PHP script running into problems. Try to clear the errors, which may fix the problem. ​Sometime ​even undefined date.timezone in php.ini may cause problems. ​+You should check the php_errors.log for the corresponding location where the PHP script running into problems. Try to clear the errors, which may fix the problem. ​Sometimes ​even undefined date.timezone in php.ini may cause problems. ​
  
 If all sites work properly, stop Apache, change "​Apache Port Offset"​ to 0, restart LSWS, all hosted web sites are powered by LiteSpeed now. If all sites work properly, stop Apache, change "​Apache Port Offset"​ to 0, restart LSWS, all hosted web sites are powered by LiteSpeed now.
  • Admin
  • Last modified: 2015/07/20 19:34
  • by Michael Alegre