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:cpanel [2013/11/25 16:21]
Michael
— (current)
Line 1: Line 1:
-====== How to use LiteSpeed with cPanel/WHM ====== 
  
-cPanel is one of the most popular web hosting control panels used by web hosting companies. cPanel uses Apache web server and depends on many Apache features. LiteSpeed web server is designed to be Apache interchangeable as a drop-in replacement. Since 2.2.5 release, LiteSpeed Web Server works very well with cPanel managed web sites. 
- 
-You will get many benefits by replacing Apache with LSWS, web pages get loaded faster, server load is lower and memory usage is lower. More web sites can now be hosted on the same server. 
- 
-This wiki will address some commonly used features for your LiteSpeed Web Server/WHM installation. The installation process is covered in our [[litespeed_wiki:​cpanel:​auto-installer|auto-installer wiki]]. 
- 
-**Note:** For free support for issues using LSWS with cPanel/WHM (i.e. problems that you have verified do not occur when you switch back to Apache), please use the [[http://​www.litespeedtech.com/​support/​forum/​|LiteSpeed forum]]. cPanel support will not handle LiteSpeed Web Server issues. 
- 
-cPanel may set permission of "/​usr/​bin/​gcc"​ to "​0700",​ which break our PHP build script. The fix is to run command ​ 
- 
-  chmod 0755 /​usr/​bin/​gcc 
- 
-after finishing the build, you can change it back with command ​ 
- 
-  chmod 0700 /​usr/​bin/​gcc 
- 
-===== Steps to replace Apache with LSWS ===== 
- 
-  * Install LiteSpeed Web Server as root user. During installation,​ make sure to set User/Group to "​nobody:​nobody",​ do **NOT** import Apache configuration,​ do **NOT** set 2080 or 80 as the HTTP service port, those ports will be used when httpd.conf is loaded. 
-  * Open LiteSpeed Web administration console, under "​server"​->"​General"​ tab, change configurations in "Using Apache Configuration File" table. 
- 
-  Load Apache Configuration => Yes 
-  Auto Reload On Changes ​   => Use Apache Binary Wrapper (Changes made in WHM/cPanel will be applied automatically) 
-  Apache Configuration File => /​usr/​local/​apache/​conf/​httpd.conf 
-  Apache Port Offset ​ => 2000      (Try LiteSpeed on port 2080 and 2443 first, change to 0 later, do NOT use 8088 or 8008) 
-  Apache IP Offset ​   => 0              
-  PHP suEXEC ​         => Yes       (Run PHP in suEXEC mode) 
-  PHP suEXEC Max Conn => 5         (The maximum PHP processor each account can have) 
- 
-"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. 
- 
-  * 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.  
- 
- 
-Note: Remember to change rc script configuration to remove httpd from the services that get started automatically during a reboot. Try this from a root shell: 
- 
-  cd /etc/init.d 
-  chkconfig httpd off 
- 
-If you have a script that monitors for the web server process, remember to update it to reflect the location of LSWS.  
- 
-**WARNING:​** Do **NOT** uncheck "​httpd"​ service under WHM service manager, otherwise WHM wont restart LiteSpeed automatically when configuration has been changed. ​ 
- 
-If your datacenter or third-party administrator monitors your web server for you, you may want to contact them to inform them of the change. 
- 
- 
- 
-===== Directory Auto Index ===== 
- 
-To turn on directory auto index, just change "Index Files" configuration  ​ 
-   Auto Index => Yes 
-   Auto Index URI => /​_autoindex/​default.php 
- 
-If PHP open_base dir option has been enabled, you may get error like  
- 
-  Warning: Unknown(): open_basedir restriction in effect. ​ 
-  File(/​usr/​local/​lsws/​share/​autoindex/​default.php) is not within the allowed path(s): ​ 
-  (/​home/​lsws:/​usr/​lib/​php:/​usr/​local/​lib/​php:/​tmp) in Unknown on line 0 
-    
-  Warning: Unknown(/​usr/​local/​lsws/​share/​autoindex/​default.php): ​ 
-  failed to open stream: Operation not permitted in Unknown on line 0 
- 
-You need to add directory "/​usr/​local/​lsws/​share/​autoindex"​ to the open_basedir list, or move dirtory "/​usr/​local/​lsws/​share/​autoindex"​ to "/​usr/​lib/​php/​autoindex",​ then create a symbolic link from "/​usr/​lib/​php/​autoindex"​ to "/​usr/​local/​lsws/​share/​autoindex"​. 
- 
-  mv /​usr/​local/​lsws/​share/​autoindex /​usr/​local/​lib/​php 
-  ln -sf /​usr/​local/​lib/​php/​autoindex /​usr/​local/​lsws/​share/​autoindex 
- 
- 
- 
-===== Run Apache behind LSWS for missing features ===== 
-There are some rarly used Apache features which are not supported by LSWS, like "​Server Side Include",​ full "​mod_perl"​ functionalities,​ mod_svn, etc., don't worry, LSWS can forward requests to Apache running behind LSWS. For example, to forward request of SSI page with suffix "​shtml"​ to Apache, do the following: 
- 
-  - Listening port of apache should be changed to 79 for HTTP and 442 for HTTP. 
-  - "​Apache Port Offset"​ configuration in LSWS should be changed to "​1",​ so LSWS will use port 80 and 443. 
-  - Set "​Apache Handled Content"​ configuration to "​.shtml",​ this will off load all request to *.shtml to backend Apache, if you want to have apache handle request with certain URL prefix, for example, a svn repository under URI "/​svn/",​ then you can set "​Apache Handled Content"​ to "​.shtml,​ /svn/" to let Apache handle both *.shtml and /svn/* 
- 
-:!: Make sure "​Port"​ directive has been changed to the port being used. 
- 
-Restart Apache and LSWS, SSI pages should be served by backend Apache now. 
- 
- 
- 
-===== FrontPage Extension ===== 
-To make FrontPage Extension work properly with LSWS, you need to the ownership and permission of //​public_html/​_vti_pvt/​service.pwd//​ for each account. //​service.pwd//​ was owned by $user:$user with permission of 0600, you need to change it to $user:​nobody with permission of 0640. 
- 
-To fix the permssion, administrator must execute two shell commands only once, if those changes are overwritten later by cPanel updates, you need to execute it again. (those are contribute by one of our user) 
- 
-  sed -rie '​s/​(safe_)?​chmod\(( )?0600,( )?​("​\$\{myuid\}",​)?​( )?"​\$(\{)?​homedir(\})?​\/​public_html\$\{subweb\}\/​_vti_pvt\/​service.pwd"​( )?​\);/​\1chmod(\20644,​\3\4\5"​$\6homedir\7\/​public_html${subweb}\/​_vti_pvt\/​service.pwd"​\8);/'​ /​scripts/​fp-auth /​usr/​local/​frontpage/​version5.0/​apache-fp/​fp-auth /​usr/​local/​cpanel/​bin/​convertfppassthrough /​scripts/​fixfrontpageperm 
- 
-then  
-  /​scripts/​fixfrontpageperm ​ 
- 
-If above commands is too much for you, just change the ownership and permission of service.pwd one by one with following command as root:  
-    
-   chgrp nobody service.pwd 
-   chmod 0640 service.pwd 
- 
- 
- 
- 
-===== Note for LiteSpeed Standard Edition ===== 
-When LiteSpeed Standard Edition is used together with hosting control, when using Apache httpd.conf, it only can import top **five** <​VirtualHost ...> configuration sections based on the order in httpd.conf. So, if your web site shows the control panel welcome page, it means the limit has been hit, you should upgrade to our Enterprise Edition. 
  • Admin
  • Last modified: 2013/11/25 16:21
  • by Michael