• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

CentOS - Installing LiteSpeed


This tutorial will walk you through installing the LiteSpeed web-server on CentOS 5.2.

The tutorial assumes the following:

  • You are working on a clean server
  • You have completed the CentOS Setup Guide
  • You are familiar with basic Linux commands
  • You are running the commands as a normal user with 'sudo' permissions

 

Contents

Update Your System

The first thing we need to do is make sure your Cloud Server has all of it's security patches. Connect to your Cloud Server with SSH (or the Console from the Control Panel) and login as your normal user. For the purposes of this walk-through our sample user is conveniently named 'user'.

Execute the YUM package manager and use the 'upgrade' command to upgrade the system:

# sudo yum upgrade

A series of items will fly by and you will be prompted to install... press Y followed by Enter. This will take a few minutes.

It is a good idea to restart your Cloud Server to make sure any new packages that were downloaded are freshly loaded.

# sudo reboot

You can use the ping command to check when your server has come back online.

$ ping 67.23.13.230

PING 67.23.13.230 (67.23.13.230) 56(84) bytes of data.
64 bytes from 67.23.13.230: icmp_seq=33 ttl=56 time=19.1 ms
64 bytes from 67.23.13.230: icmp_seq=34 ttl=56 time=9.52 ms
64 bytes from 67.23.13.230: icmp_seq=35 ttl=56 time=10.4 ms
...

Once it is responding to ping requests go ahead and connect to your Cloud Server again.

Install developer tools

If you haven't installed them already, you should install the CentOS standard developer tools to cover a requirement for glibc (and because the dev tools can be useful to have around).

sudo yum groupinstall 'Development Tools'

Download LiteSpeed

Now we need to download the LiteSpeed web server. This walk-through will cover installation of the free Standard Edition.

To download the software you will need to do the following:

  • Visit the LiteSpeed download page
  • Scroll down to LiteSpeed Web Server Standard Edition: Free
  • Download the file associated with Linux (x86)
  • Transfer the file to your Cloud Server (not covered in this tutorial)

Another option is to copy the direct link and download the file manually on your Cloud Server. For purposes of demonstration we will show you this option. The link below was valid at the time of writing and may have changed -- please adjust accordingly.

# cd ~
# wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.3-std-i386-linux.tar.gz

You will see the wget utility appear and it will download the file. Once it has finished you will be returned to the prompt.

Installing LiteSpeed

We need to unpack the LiteSpeed package that we downloaded. Type the following command to unpack: (note that your file name may be different)

# sudo tar -zxvf lsws-4.0.3-std-i386-linux.tar.gz

Now we need to enter the directory that we extracted the files into:

# cd lsws-4.0.3

We are now ready to start the installer. Type the following command to start the installer:

# sudo ./install.sh

You will be prompted with a license agreement. Read the agreement and press the space bar multiple times until you reach the end.

After you 'space' through the license you will be prompted with the following:

IMPORTANT: In order to continue installation you must agree with above 
           license terms by typing "Yes" with capital "Y"! 

Do you agree with above license? 

Type Yes at this point and press Enter. Note that you *must* put a capital Y.

The next screen that appears will ask you what directory you would like to install LiteSpeed. The default directory is sufficient. Simple press Enter to accept the default.

Please specify the destination directory. You must have permissions to 
create and manage the directory. It is recommended to install the web server 
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.

ATTENTION: The user 'nobody' must be able to access the destination
           directory.

Destination [/usr/local/lsws]: 

The next prompt will ask you for the administrative login that you would like to use for the administrative console. Simply press Enter to accept the default.

Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.

User name [admin]: 

Enter the password that you'd like to use for administering your web server. Please make sure this is secure as it has the power to stop your server! Press Enter once you have entered it.

Please specify the administrator's password.
This is the password required to log into the administration web interface.

Password: 

Retype the password again.

Enter an e-mail address for the server administrator. This will be displayed on error messages so the server administrator may be contacted in the event of server failure.

Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma 
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to 
emails listed here.

Email addresses [root@localhost]: 

Next you will be prompted for the user that the web server should run as. Leave it the default user of nobody and press Enter.

As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
'nobody'.

User [nobody]: 

You will be asked for the group next. Press Enter.

Please choose the group that the web server running as.

User 'nobody' is the member of following group(s):  nobody
Group [nobody]: 

Next you will be prompted for the port that the web server should answer on. Default HTTP traffic is port 80. Because the default port that the server selects is not correct, type in 80 and press Enter.

Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use 
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://<YOUR_HOST>:<HTTP_PORT>/

HTTP port [8088]: 80

You will be prompted for the port that the administrative control panel should answer on. We will select the default port of 7080. Simply press Enter.

Please specify the HTTP port for the administration web interface,
which can be accessed through http://<YOUR_HOST>:<ADMIN_PORT>/

Admin HTTP port [7080]: 

You will be asked if you would like to install PHP support. For our demonstration we will turn on PHP support. Type Y and press Enter.

You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which  
outperforms Apache's mod_php. 
You can always replace the pre-built PHP engine with your customized PHP 
engine.

Setup up PHP [Y/n]: Y

You will then be asked for the default PHP extension. Select the default PHP and press Enter.

Suffix for PHP script(comma separated list) [php]:

Next you will be prompted to install AWStats, a web-traffic logger. For our demonstration we have chosen to not install it. Press N and then press Enter.

AWStats is a popular log analyzer that generates advanced web server 
statistics. LiteSpeed web server seamlessly integrates AWStats into 
its Web Admin Interface. AWStats configuration and statistics update
have been taken care of by LiteSpeed web server.

Note: If AWStats has been installed already, you do not need to
      install again unless a new version of AWStats is available.

Would you like to install AWStats Add-on module [y/N]? N

A large amount of text will pass (please read!) and then you will be prompted if you would like LiteSpeed to start automatically. Press Y and then Enter.

Would you like to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]? Y

If that step completes successfully you will be asked if you would like to start LiteSpeed now. Press Y and then press Enter.

[OK] The startup script has been successfully installed!
Would you like to start it right now [Y/n]? Y

If the server starts successfully you will be given an output that looks similar to the one below:

[OK] lshttpd: pid=4517.

LiteSpeed Web Server started successfully! Have fun!

Testing LiteSpeed

Open up your web-browser and point it to your Cloud Server's IP address (or domain name if you have DNS setup). You should see something like the following:

litespeed_test.png

If you receive a similar screen then you have successfully installed LiteSpeed! Be sure to check out your administrative control panel at http://12.34.56.78:7080/. Change 12.34.56.78 to your IP address. If you changed the administrative port number you will have to change that as well.

--Kelly Koehn 14:32, 15 May 2009 (CDT)



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

18 Comments

I got the following error:
/usr/local/lsws/bin/lswsctrl: ./litespeed: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
[ERROR] Failed to start litespeed!

While was fixed by typing
yum install ld-linux.so.2

Then after that installed type
/usr/local/lsws/bin/lswsctrl start

Thanks for letting us know about that one John. That's an unexpected error, certainly. What CentOS version do you have installed?

I receive the same error

We'll need to take a closer look at the process here to see what may be off with newer CentOS images. In the meantime you might try a newer version of lightspeed than what's referenced in the article. You can find the latest version on their website: http://www.litespeedtech.com/litespeed-web-server-downloads.html

yum install libgcc.i686
yum install glibc.i686

The base 64 bit images are missing these two packages.

Thanks for that clarification. I'll add a note to install the developer tools to this article.

This is driving me virtually insane. I installed this once, and it worked fine. In the admin area there was an option to upgrade PHP and I had an issue, there (it said it couldn't find fetch, wget, nor curl). Now - here's the crazy part. I uninstalled the thing using the included script. I have never been able to get it working again. It runs through the installation, tells me it's started (and to have fun), and, it's not running. It's been 3 days - I even tried it on Ubuntu (hey, I was desperate) and the logs are not very helpful. The top of the error log says that everything is fine (user and group nobody exist, swap space is working, etc.), and, the bottom looks like this:


2012-11-01 01:25:22.115 [NOTICE] Start to clean up cache directory, pid=4301
2012-11-01 01:25:22.323 [INFO] Stop listener *:80.
2012-11-01 01:25:22.323 [INFO] Stop listener *:7080.
2012-11-01 01:25:22.323 [NOTICE] [Child: 4299] Start shutting down gracefully ...
2012-11-01 01:25:22.323 [NOTICE] New litespeed process is ready, stop listeners
2012-11-01 01:25:22.323 [INFO] Stop listener *:80.
2012-11-01 01:25:22.323 [INFO] Stop listener *:7080.
2012-11-01 01:25:22.323 [NOTICE] [Child: 4299] Shut down successfully!
2012-11-01 01:25:22.324 [NOTICE] [AutoRestarter] cleanup children processes and unix sockets of process with pid=4299 !
2012-11-01 01:25:22.425 [NOTICE] [AutoRestarter] child process with pid=4299 exited with status=0!
2012-11-01 01:25:22.425 [NOTICE] [PID:4295] Server Stopped!

It apparently starts, for a split second, and dies. As I've tried multiple versions on various distros, and various computers. The installation - unless I'm really missing something - is nothing short of brain dead. What could possibly be going on here? When I try to start it, it simply says it can't be started and to read the docs..... Thanks for any clues.

What is the error you're receiving when trying to start Litespeed? There are some other users on the Litespeed forums who seem to be experiencing the same issues you are, and the recommended solution is to upgrade/re-install to the latest version (http://www.litespeedtech.com/support/forum/showthread.php?t=6230). It would also help if you included the full error log in a link from pastebin.com (or similar).

I'd only recently heard of this thing and done no research regarding it's setup, etc. I "found" it on the web and it was some sort of hack job. I told Litespeed the truth - that I simply fiddling around and had originally tried a hacked version. Originally, I'd thought it was free...period. Anyway, when the server fires up it apparently speaks to Litespeed's licensing department. And, once it's sent them phony baloney info they prevent any version from running on your computer - which makes sense. At any rate, in my case that was the problem. I told them what I'd done and they said, essentially, "no problem". They threw a switch, and it works great. I'll be posting from a penal institution, next. Color me "bad".

sudo yum upgrade
sudo reboot
sudo yum groupinstall 'Development Tools'
cd ~
wget http://www.litespeedtech.com/packages/4.0/lsws-4.2.1-std-i386-linux.tar.gz
sudo tar -zxvf lsws-4.2.1-std-i386-linux.tar.gz
cd lsws-4.2.1
sudo ./install.sh
***** finish the setup process ****
** DO not inastall AWstatus
//open port 80 and 7080
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 7080 -j ACCEPT
sudo service iptables save

This is upgrade litespeed installation , I installed it at centos CentOS 5.8 server :


sudo yum upgrade
sudo reboot
sudo yum groupinstall 'Development Tools'
cd ~
wget http://www.litespeedtech.com/packages/4.0/lsws-4.2.2-std-i386-linux.tar.gz
sudo tar -zxvf lsws-4.2.2-std-i386-linux.tar.gz
cd lsws-4.2.2
sudo ./install.sh
***** finish the setup process ****
** DO not inastall AWstatus
//open port 80 and 7080
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 7080 -j ACCEPT
sudo service iptables save

To Update PHP, need to update flowing command
----------------------------
yum install libxml2-devel.x86_64 openssl-devel.x86_64 bzip2-devel.x86_64 libcurl-devel.x86_64 db4-devel.x86_64 \
libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 freetype-devel.x86_64 gmp-devel.x86_64 \
libc-client-devel.x86_64 openldap-devel.x86_64 libmcrypt-devel.x86_64 mhash-devel.x86_64 freetds-devel.x86_64 \
zlib-devel.x86_64 mysql-devel.x86_64 ncurses-devel.x86_64 pcre-devel.x86_64 unixODBC-devel.x86_64 postgresql-devel.x86_64 \
sqlite-devel.x86_64 aspell-devel.x86_64 readline-devel.x86_64 recode-devel.x86_64 net-snmp-devel.x86_64 \
libtidy-devel.x86_64 libxslt-devel.x86_64 t1lib-devel.x86_64
----------------------------

Light speed forum link: http://www.litespeedtech.com/support/forum/showthread.php?t=6463


-

Thanks for sharing what you've learned, Al Rashid. We need to revisit this article, and your comments are a big help.

Thanks for your appreciation.

Installed and look like it worked out just fine, but i can't access the admin area at port 7080 and i have not changed that during install...

Any ideas?

You might need to open the port in the firewall. As some comments above suggest, try running:

sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 7080 -j ACCEPT
sudo service iptables save

That should make sure port 7080 is open in the firewall. If you open the port and still can't connect, check the litespeed logs to see if it's getting the connection and failing to handle it for another reason.

did you change your admin port during installation ?

Thanks i made it work it was what was wrong :) 7080 had to be opened in the firewall. Thank You very much.

Add new comment