How to install OpenLiteSpeed in Ubuntu

To install OpenLiteSpeed in Ubuntu

OpenLiteSpeed is a light-weight and high performance HTTP server, which supports both plain text configuration files and native Litespeed XML configuration files. It is an open-source server that serves and manages sites. It permits the users to use, download, modify and distribute its source code. Installation of OpenLiteSpeed is explained in this article.

To install LiteSpeed

First, update your repositories by using the following command.

root@linuxhelp:~# apt-get update  
Hit http://security.ubuntu.com wily-security InRelease
Hit http://in.archive.ubuntu.com wily InRelease  
Hit http://in.archive.ubuntu.com wily-updates InRelease               
Hit http://security.ubuntu.com wily-security/main Sources              
Hit http://in.archive.ubuntu.com wily-backports InRelease   
Hit http://security.ubuntu.com wily-security/restricted Sources          
.
.
.
Hit http://in.archive.ubuntu.com wily-backports/universe amd64 Packages                                                                                                     
Hit http://in.archive.ubuntu.com wily-backports/multiverse amd64 Packages                                                                                                   
Hit http://in.archive.ubuntu.com wily-backports/main i386 Packages                                                                                                          
Hit http://in.archive.ubuntu.com wily-backports/restricted i386 Packages                                                                                                    
Hit http://in.archive.ubuntu.com wily-backports/universe i386 Packages                                                                                                      
Hit http://in.archive.ubuntu.com wily-backports/multiverse i386 Packages                                                                                                    
Hit http://in.archive.ubuntu.com wily-backports/main Translation-en                                                                                                         
Hit http://in.archive.ubuntu.com wily-backports/multiverse Translation-en                                                                                                   
Hit http://in.archive.ubuntu.com wily-backports/restricted Translation-en                                                                                                   
Hit http://in.archive.ubuntu.com wily-backports/universe Translation-en
Reading package lists... Done


After updating the system, install the necessary packages for LiteSpeed.

root@linuxhelp:~# apt-get install build-essential libexpat1-dev libgeoip-dev libpng-dev libpcre3-dev libssl-dev libxml2-dev rcs zlib1g-dev -y 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting ' libpng12-dev'  instead of ' libpng-dev' 
build-essential is already the newest version.
build-essential set to manually installed.
The following extra packages will be installed:
  geoip-bin icu-devtools libexpat1 libicu-dev libpcre16-3 libpcre3 libpcre32-3 libpcrecpp0v5 libpng12-0 libssl-doc libssl1.0.0 libxml2
Suggested packages:
  icu-doc
.
.
.
Setting up libpcre32-3:amd64 (2:8.35-7.1ubuntu1.4) ...
Setting up libpcre3-dev:amd64 (2:8.35-7.1ubuntu1.4) ...
Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4) ...
Setting up libpng12-dev:amd64 (1.2.51-0ubuntu3.15.10.2) ...
Setting up libssl-dev:amd64 (1.0.2d-0ubuntu1.5) ...
Setting up libssl-doc (1.0.2d-0ubuntu1.5) ...
Setting up libxml2-dev:amd64 (2.9.2+zdfsg1-4ubuntu0.4) ...
Setting up rcs (5.9.4-3) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...


Download OpenLiteSpeed source package using wget command.

root@linuxhelp:~# wget http://open.litespeedtech.com/packages/openlitespeed-1.3.10.tgz 
--2016-10-15 03:05:53--  http://open.litespeedtech.com/packages/openlitespeed-1.3.10.tgz
Resolving open.litespeedtech.com (open.litespeedtech.com)... 173.205.184.60
Connecting to open.litespeedtech.com (open.litespeedtech.com)|173.205.184.60|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2100495 (2.0M) [application/x-gtar]
Saving to: ‘ openlitespeed-1.3.10.tgz’ 

openlitespeed-1.3.10.tgz                    100%[==========================================================================================> ]   2.00M   498KB/s   in 4.3s   

2016-10-15 03:05:58 (475 KB/s) - ‘ openlitespeed-1.3.10.tgz’  saved [2100495/2100495]


Once the download is completed, extract the downloaded tar package.

root@linuxhelp:~# tar -xzvf openlitespeed-1.3.10.tgz  
openlitespeed-1.3.10/
openlitespeed-1.3.10/CMakeLists.txt
openlitespeed-1.3.10/Makefile.am
openlitespeed-1.3.10/fixtimestamp.sh
openlitespeed-1.3.10/ax_lib_expat.m4
openlitespeed-1.3.10/adminssl.conf
openlitespeed-1.3.10/format.sh
openlitespeed-1.3.10/README.md
openlitespeed-1.3.10/missing
.
.
.
openlitespeed-1.3.10/src/modules/cache/dirhashcacheentry.cpp
openlitespeed-1.3.10/src/modules/cache/cacheentry.h
openlitespeed-1.3.10/src/modules/cache/cachehash.h
openlitespeed-1.3.10/src/modules/cache/cacheentry.cpp
openlitespeed-1.3.10/src/modules/cache/dirhashcacheentry.h
openlitespeed-1.3.10/src/modules/prelinkedmods.cpp
openlitespeed-1.3.10/src/modules/Makefile.in
openlitespeed-1.3.10/src/main.cpp
openlitespeed-1.3.10/src/httpdtest.h

To configure OpenLiteSpeed

Before installing, configure OpenLiteSpeed by following the below steps.

root@linuxhelp:~# ls 
Desktop  Documents  Downloads  examples.desktop  Music  openlitespeed-1.3.10  openlitespeed-1.3.10.tgz  Pictures  Public  Templates  Videos
root@linuxhelp:~# cd openlitespeed-1.3.10/
root@linuxhelp:~/openlitespeed-1.3.10# ./configure  
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/user1/openlitespeed-1.3.10/missing: Unknown ' --is-lightweight'  option
Try ' /home/user1/openlitespeed-1.3.10/missing --help'  for more information
configure: WARNING: ' missing'  script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
.
.
.
config.status: creating src/sslpp/Makefile
config.status: creating src/ssi/Makefile
config.status: creating src/util/Makefile
config.status: creating src/lsiapi/Makefile
config.status: creating src/modules/Makefile
config.status: creating src/modules/cache/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands


Run make script to install OpenLiteSpeed.

root@linuxhelp:~/openlitespeed-1.3.10# make 
Making all in src
make[1]: Entering directory ' /home/user1/openlitespeed-1.3.10/src' 
make  all-recursive
make[2]: Entering directory ' /home/user1/openlitespeed-1.3.10/src' 
Making all in socket
make[3]: Entering directory ' /home/user1/openlitespeed-1.3.10/src/socket' 
.
.
.
make[3]: Leaving directory ' /home/user1/openlitespeed-1.3.10/src' 
make[2]: Leaving directory ' /home/user1/openlitespeed-1.3.10/src' 
make[1]: Leaving directory ' /home/user1/openlitespeed-1.3.10/src' 
make[1]: Entering directory ' /home/user1/openlitespeed-1.3.10' 
make[1]: Nothing to be done for ' all-am' .
make[1]: Leaving directory ' /home/user1/openlitespeed-1.3.10' 
root@linuxhelp:~/openlitespeed-1.3.10# make install 
Making install in src
make[1]: Entering directory ' /home/user1/openlitespeed-1.3.10/src' 
Making install in socket
make[2]: Entering directory ' /home/user1/openlitespeed-1.3.10/src/socket' 
make[3]: Entering directory ' /home/user1/openlitespeed-1.3.10/src/socket' 
make[3]: Nothing to be done for ' install-exec-am' .
make[3]: Nothing to be done for ' install-data-am' .
.
.
.
-e Installation finished, Enjoy!

( rm -f /usr/local/lsws/modules/cache.la )
make[3]: Leaving directory ' /home/user1/openlitespeed-1.3.10' 
make[2]: Leaving directory ' /home/user1/openlitespeed-1.3.10' 
make[1]: Leaving directory ' /home/user1/openlitespeed-1.3.10' 


Run the following command to install MySQL server for OpenLiteSpeed to store the data.

root@linuxhelp:~# apt-get install mysql-server -y 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.6 mysql-client-core-5.6 mysql-common mysql-server-5.6
  mysql-server-core-5.6
.
.
.
2016-10-15 03:15:40 0 [Note] /usr/sbin/mysqld (mysqld 5.6.31-0ubuntu0.15.10.1) starting as process 20057 ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up mysql-server (5.6.31-0ubuntu0.15.10.1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...


Create administrator account by using the below command.

root@linuxhelp:~# /usr/local/lsws/admin/misc/admpass.sh 

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: linuxhelp

Please specify the administrator' s password.
This is the password required to login the administration Web interface.

Password:
Retype password: 
Administrator' s username/password is updated successfully!


Then start the services for OpenLiteSpeed.

root@linuxhelp:~# service lsws start
root@linuxhelp:~# service lsws status 
 lsws.service - LSB: lshttpd
   Loaded: loaded (/etc/init.d/lsws)
   Active: active (running) since Sat 2016-10-15 03:20:42 IST  11s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 20718 ExecStart=/etc/init.d/lsws start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/lsws.service
           ??20732 openlitespeed (lshttpd - main)
           ??20734 openlitespeed (lscgid)
           ??20735 openlitespeed (lshttpd - #01)

Oct 15 03:20:39 linuxhelp systemd[1]: Starting LSB: lshttpd...
Oct 15 03:20:42 linuxhelp systemd[1]: Started LSB: lshttpd.


Open the browser and trigger the OpenLiteSpeed default web page with the help of the IPaddress and port number 8088.

To access the admin control panel, use the ip address along with port number 7080.

Enter into the LiteSpeed using the Login credentials.

FAQ
Q
Does OpenLiteSpeed support Server Side Include?
A
OpenLiteSpeed 1.4.x is not yet supporting "server side includes". It is a planned feature for 1.5 branch. LiteSpeed Enterprise supports "server side includes" since 4.x version.
Q
What is the purpose of using the OpenLitespeed?
A
OpenLiteSpeed is a light-weight and high performance HTTP server, which supports both plain text configuration files and native Litespeed XML configuration files. It is an open-source server
Q
Does OpenLiteSpeed support .htaccess?
A
No. Only LiteSpeed Enterprise support .htaccess. However, OpenLiteSpeed does support rewire rules. You can enable rewrite rules in virtualhost or context of virtualhost section.
Q
Does OpenLiteSpeed have QUIC support? if not will it have QUIC support?
A
Right now QUIC is for LSWS enterprise only. There is no timeline to offer QUIC support for OLS yet.
Q
How can I improve my site’s performance?
A
Improving your site’s performance is our mission. All of our products are made with this goal in mind. Learn more about how LiteSpeed Web Server and our cache solutions can deliver superior p