Call us 7am to midnight (GMT)
02037453658

How to Install LiteSpeed on a WHM / cPanel Server

  (by )

Here’s how you install LiteSpeed on a WHM/cPanel Server – it should take about 25minutes from start to finish, only about 5 of those minutes involve you doing anything, and it should give you no downtime during the installation procedure. (Although don’t quote me on that – we did install LiteSpeed in a maintenance window and advise you to do the same!)

To write this tutorial I installed LiteSpeed onto one of our Fully Managed Servers which was previously pulling a load average of 15-20, running low on RAM and had sluggish page load times due to a very high amount of visitors. Since installation the load immediately dropped to 1.8, it has 50% RAM free and the sites hosted on it are loading instantly, we love Litespeed – it is absolutely brilliant – if you’re still running Apache with cPanel you probably shouldn’t be! 🙂 Imagine that sort of performance boost across a whole shared hosting network with no extra hardware cost!

How to Install LiteSpeed on a WHM/cPanel Server

– Go buy a license from LiteSpeed and note down the license key. (They also do a free 14 day trial).

– Login to SSH as ‘root’ on the server running cPanel.

– Copy/paste the following command and hit enter:

cd /usr/src; wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh; chmod 700 lsws_whm_plugin_install.sh; ./lsws_whm_plugin_install.sh; rm -f lsws_whm_plugin_install.sh

– Login to WHM and click the ‘LiteSpeed Web Server’ button.

– Click ‘Install LiteSpeed’ and let it run through the installation procedure, this is completely automated.

– Enter your license information & assign an administrator password (Don’t tick the box to start LiteSpeed immediately!)

– Click ‘Build matching PHP Binary’ – this will take 10-20mins (Apache will stay running)

– Click ‘Switch to LiteSpeed’

– Click ‘Admin Web Console’ and login with the details you setup in step 5.

Final stages of setup (Most of which is in LiteSpeed admin)

– Configuration > General > Index Files > Edit

Set the following:

Index Files: index.html, index.php, index.php5, index.htm

Auto Index: Yes

Auto Index URI => /_autoindex/default.php

Hit ‘Save’

In SSH Type:

ln -sf /usr/local/lib/php/autoindex /usr/local/lsws/share/autoindex

Now back to LiteSpeed Admin:

– Configuration > Log > Server Log > Edit

Set the following:

Log Level: Info

Debug Level: None

Hit ‘Save’

Now click ‘Actions > Graceful Restart’ to make these changes permanent.

Optional LiteSpeed Installation Procedures

Want your users to be able to have their own PHP.INI file?

In LiteSpeed Admin:

– Configuration > External App – then hit ‘Edit’ next to ‘LSAPI App / lsphp5 / uds://tmp/lshttpd/lsphp5.sock’ if you’re running PHP5 (or the one for lsphp4 if running PHP4)

In ‘Environment’ add the following line:

PHPRC=$VH_ROOT/

Then hit ‘Save’

Now click ‘Actions > Graceful Restart’ to make these changes permanent.

This will allow them to have their very own php.ini in the root folder of their hosting account which overrides the /usr/local/lib/php.ini file, this is a security risk though so be careful.

Want your users to be able to use Frontpage Extensions?

Run this command from SSH:

sed -rie ‘s/(safe_)?chmod(( )?0600,( )?(“${myuid}”,)?( )?”$({)?homedir(})?/public_html${subweb}/_vti_pvt/service.pwd”( )?);/1chmod(20644,345″$6homedir7/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 run this command from SSH:

/scripts/fixfrontpageperm

Forgot your LiteSpeed admin pass?

Run this within SSH to reset your LiteSpeed Admin Pass: /usr/local/lsws/admin/misc/admpass.sh

Got any questions about LiteSpeed? Ask them on the LiteSpeed forum.

2 Comments

  1. On November 15, 2010 at 12:10 pm

    Housekeeping said:

    That’s a very intense claim that Litespeed makes – “6 times faster than Apache…(and) 50% faster for dynamic PHP content than Apache with mod_php”. Litespeed looks like one to investigate. Thanks for the heads up.

  2. On September 29, 2010 at 7:31 pm

    John said:

    I’ve been trying to figure this out for ages – thank you so much for the guide. Finally I’ve got litespeed installed!