CentOS - Installing LiteSpeed
This tutorial will walk you through installing the LiteSpeed web-server on CentOS 5.2, and that you have completed the following prerequisites:
- You are working on a clean server
- You have completed the steps to set up your CentOS server (see CentOS/Fedora/REL Setup - Cloud Servers)
- You are familiar with basic Linux commands
- You are running the commands as a normal user with 'sudo' permissions
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 220.127.116.11 PING 18.104.22.168 (22.214.171.124) 56(84) bytes of data. 64 bytes from 126.96.36.199: icmp_seq=33 ttl=56 time=19.1 ms 64 bytes from 188.8.131.52: icmp_seq=34 ttl=56 time=9.52 ms 64 bytes from 184.108.40.206: 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'
sudo 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
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.2.4-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.
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.2.4-std-i386-linux.tar.gz
Now we need to enter the directory that we extracted the files into:
# cd lsws-4.2.4
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 : 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 :
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!
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:
If you receive a similar screen then you have successfully installed LiteSpeed! Be sure to check out your administrative control panel at
http://220.127.116.11:7080/ (change 18.104.22.168 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)
© 2015 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