Table of Contents

How to replace Apache with LiteSpeed when used with DirectAdmin

With LSWS 3.3.1 Enterprise or later versions, the LSWS installer can setup configuration for DirectAdmin 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

Load Apache Configuration => Yes
Auto Reload On Changes    => Yes (Changes made in DirectAdmin will be applied automatically)
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)

chown apache:nobody /var/log/httpd/domains

1. in file /var/www/html/webmail/inc/config.php changes $temporary_directory… to:

$uidinfo = posix_getpwuid(posix_getuid()); 
$temporary_directory = (($uidinfo['name']=='apache')?'tmp/':"/home/".$uidinfo['name']."/webmail/uebimiau/");

2. in file /var/www/html/squirrelmail/config/config.php shoud insert after line

$data_dir = SM_PATH . 'data/'; 

these lines:

$uidinfo = posix_getpwuid(posix_getuid()); 
if($uidinfo['name']!='apache') { 
  @mkdir("/home/".$uidinfo['name']."/webmail");
  @mkdir("/home/".$uidinfo['name']."/webmail/squirrelmail"); 
  $data_dir = "/home/".$uidinfo['name']."/webmail/squirrelmail/"; 
}
  1. Open /usr/local/directadmin/data/admin/services.status in any editor
  2. Set HTTPD to “OFF” (instead of ON)
  3. Restart the DirectAdmin service

Note: 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 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.