Unless you’ve been living under a rock you know we run Litespeed and have so for a year now. I’ve noticed since we’ve been using Litespeed the installation information and tutorials as far as setting it up in a cPanel environment have become really out of date. This could be my fault with asking for fixes and features to be added to cater to cPanel and solve various problems. Obviously I don’t know if that’s correct it’s me causing it but since we started using it seems like we’ve found a lot of issues relating to cPanel integration with have been fixed. Unfortunately though the wiki entries Litespeed has on their site still reference things not necessary anymore. So I’m going to quickly run by how to install and setup Litespeed on a cPanel server.
So first of all obviously you’ll want to have a license then go and download Litespeed from their download page.
You’ll extract the archive and run through the installer picking cPanel as your control panel then everything else should be fine as the defaults. I’m avoiding talking about these early steps as really if you cannot download a file then run the installer then you should have a system admin.
So now we’ve got Litespeed installed but now is where you need to start configuring things. By default Litespeed is not configured to be exactly like Apache in some ways so could cause issues for some users. The first thing I do is login to the control panel which would be http://yourip:7080/
So you’ll be greeted with a page like this:
So from here you’ll want to go to configuration so you’ll be sent to the following page:
The first step is to go to the log page and change the debug level to none and and log level to INFO. So like the picture below
Obviously in your case you’ll click the edit button then save it rather than looking at just the text version like the screen shot.
So now you’ve set the logs next you need to change the auto index which you do back on the general configuration page you at the index files portion. You’ll want to set it as follows:
Auto Index => Yes
Auto Index URI => /_autoindex/default.php
Then as root you’ll want to run
ln -sf /usr/local/lib/php/autoindex /usr/local/lsws/share/autoindex
Now finally on the same general configuration page if you plan on supporting frontpage extensions you’ll want to turn it on. You do this under the Using Apache Configuration File portion of the general configuration page.
Once you’ve done all of this restart Litespeed as it’ll be asking you to and all your changes will take effect.
You’ve now setup Litespeed from the panel side it should act pretty much the same as Apache as far as the users are concerned. They’ll have the error log portions working in cPanel and nothing extra confusing for them. The auto index when no index file is found will work as expected no weird errors there. Then finally if you choose to support frontpage extensions they should work fine with no changes from your end. This is one portion the wiki is out of date on now none of the commands it says to run are actually necessary.
We’re not done yet though we still have to configure PHP which is very easy to do. Login to your WHM and go to plugins on the left menu and you’ll see a LiteSpeed Web Server link. Your page should look something like this:
The first step on this page is to get the same PHP version on Litespeed as you have on Apache. What you want to select is the Build Matching PHP Binary option which will look at your current PHP version in Apache. What it will attempt to do is use the source from /home/cpeasyapache/src if available to build it’s PHP identical to cPanel as it would use the cPanel PHP source. If it’s not available then it will download it’s own copy from php.net and build the same options in from there.
You give that 10 minutes and now you just need to switch to Litespeed which you do from the switch to LiteSpeed option from the WHM plugin. It will turn off Apache and turn on Litespeed and have it read the httpd.conf file. Then you just need to check make sure everything is still working as it should. If it’s a production server you can also access Litespeed from an alternate port when Apache is still running which typically is 2080. So you could go to http://somesite.com:2080/ and make sure it’s PHP works fine and such.
Well I hope that was helpful to anyone out there trying to configure Litespeed and are not sure what portions of their wiki are up to date and which are not.