Wiki
 

How to replace Apache with LiteSpeed when used with Plesk

With LSWS 3.3.1 Enterprise or later, the LSWS installer can setup configuration for Plesk automatically. The default LSWS configuration comes with support for both PHP4 and PHP5, however, only pre-built PHP4 binary is available, if you want PHP5 support, you need to build PHP5 binary yourself. Just login to the web console then select “Actions”→“Build PHP“. You should use the same PHP configuration used for building Apache mod_php to build the lsphp binary, you can get the information from a phpinfo() page.

Steps to replace Apache with LSWS

  • Install LiteSpeed Web Server as root user – just run ./install.sh at command line. During installation, when you see
Will you use LiteSpeed Web Server with a hosting control panel?
  0. NONE
  1. cPanel
  2. DirectAdmin
  3. Plesk
  4. Hsphere
  5. Interworx
  6. Lxadmin
  7. ISPManager
Please select (0-7) [0]? 

For CentOS, just input 3 to select Plesk and select default, for Debian, should select NONE and update configurations manually via web console later. Also, you may need to set user/group to “www-data/www-data” when installer prompt for “User” and “Group” for Debian based installation.

Port Offset [2000]?

to run litespeed on port 2080 and apache on 80 at the same time.

  • Open LiteSpeed Web administration console, under “server”→“General” tab, view configurations in “Using Apache Configuration File” table. For Debian based installation, you need to manually set those configurations
Load Apache Configuration => Yes
Auto Reload On Changes    => User Apache binary Wrapper
Apache Binary Path        => /usr/sbin/httpd  (or /usr/sbin/httpd.worker if worker MPM is used)
Apache Configuration File => /etc/httpd/conf/httpd.conf
Apache Port Offset  => 2000      (Try LiteSpeed on port 2080 and 2443 first, change to 0 later)
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)

if previously all your PHP scripts run as “apache” user, then change above “PHP suEXEC” as “No”, and restart LSWS.

For Debian based installation, you may need to set “Apache Environment” according to /etc/apache2/envvars

  • Now LSWS host web sites 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.
  • in case you may fail to stop Apache(service httpd stop;service httpd status) after LSWS installed: check if /usr/sbin/httpd_ls_bak exists and /usr/sbin/httpd is just an lsws wrapper. then
/usr/sbin/httpd uninstall
service httpd stop
service httpd status

above “service httpd status” is to ensure apache stopped. then restart LSWS, to have it running on port 80 or 2080.

  • you may need 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. 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.

NOTE: If Apache worker MPM is used instead of the default prefork MPM, Plesk may complain about restarting Apache, if it happens, you have two choices to fix it.

  • to change Apache configuration back to prefork MPM, open /etc/sysconfig/httpd, comment out the line starting with “HTTPD=…”.
  • login to LSWS console, update “Apache Binary Path” from /usr/sbin/httpd to /usr/sbin/httpd.worker.

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.

 
litespeed_wiki/apache/plesk.txt · Last modified: 2011/11/11 16:50 (external edit)