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
litespeed_wiki:apache:migration [2015/07/07 20:44]
Jackson Zhang [1.3 Run the installation script]
litespeed_wiki:apache:migration [2015/07/20 19:36]
Michael Alegre removed
Line 34: Line 34:
   ./​install.sh   ./​install.sh
  
-The installer will ask you a number of questions (covered in detail [[http://​www.litespeedtech.com/​docs/​webserver/​install|here]]). ​When in doubt, ​choose ​the default ​for all questions:+The installer will ask you a number of questions (covered in detail [[http://​www.litespeedtech.com/​docs/​webserver/​install|here]]). ​Choose the default setting when in doubt, ​but you have to set the same username and groupname as Apache ​for LiteSpeed process to run as (choosing LiteSpeed default setting nobody:​nobody may create file permission problem):
     * LiteSpeed target install directory (/​usr/​local/​lsws).     * LiteSpeed target install directory (/​usr/​local/​lsws).
     * Assign the same username and group as Apache for LSWS to run as (You need to check with Apache configuration or Apache running process. It maybe nobody:​nobody,​ apache:​apache or www-data:​www-data etc.)     * Assign the same username and group as Apache for LSWS to run as (You need to check with Apache configuration or Apache running process. It maybe nobody:​nobody,​ apache:​apache or www-data:​www-data etc.)
-    * Listen port (8088)(8088 is for testing site only. LSWS will automatically check Apache configuration for Listening port if "Load Apache Configure"​ selected as instructed below).+    * Listen port (8088)(8088 is for sample ​testing site only. LSWS will automatically check Apache configuration for Listening port if "Load Apache Configure"​ selected as instructed below).
     * Default Web Admin Port:7080     * Default Web Admin Port:7080
     * Assign a username and password for LSWS web admin console.     * Assign a username and password for LSWS web admin console.
Line 45: Line 45:
 Two options for setting up PHP for LiteSpeed: 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. +  - 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 from source. See [[litespeed_wiki:​apache:​migration:​buildphp|instructions]] here. +  - 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 LiteSpeed Web admin console, under "​server"​→"​General"​ tab, change configurations in "Using Apache Configuration File" table.
Line 91: Line 94:
   ​   ​
 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: Start LiteSpeed ​again =====+===== Step 4: Test and switch to LiteSpeed ​ =====
  
-Restart LSWS and try web sites hosted on port 2080 and secured sites on 2443. If all sites work properly, stop Apache, change "​Apache Port Offset"​ to 0, restart LSWS, all hosted web sites are powered by LiteSpeed now.+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 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.  
 + 
 +  /​usr/​local/​lsws/​logs/​error.log 
 +  /​usr/​local/​lsws/​logs/​stderr.log 
 +   
 +For PHP error logs, they are normally located at the directory where PHP script runs: 
 + 
 +You may go to your server document root and find them: 
 +  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.  
 + 
 +If all sites work properly, stop Apache, change "​Apache Port Offset"​ to 0, restart LSWS, all hosted web sites are powered by LiteSpeed now.
  
 **Note:** Remember to change rc script configuration to remove httpd from the services that get started automatically during a reboot. For example, On CentOS, try this from a root shell: **Note:** Remember to change rc script configuration to remove httpd from the services that get started automatically during a reboot. For example, On CentOS, try this from a root shell:
Line 106: Line 123:
   update-rc.d -f apache2 ​ remove   update-rc.d -f apache2 ​ remove
   update-rc.d lsws defaults   update-rc.d lsws defaults
- 
 ===== Step 5: Monitor ===== ===== Step 5: Monitor =====