Install OpenLiteSpeed from Source with Build Script for OLS 1.6 and above

You are here:
< Back

These days it’s not too popular to install OpenLiteSpeed from source. Installing OLS from a repository, or installing a binary directly, is so much easier than compiling from source code. However, there are still some who prefer the old way, for whatever reason (maybe special requirements, or just plain habit).

If you are such a user, you are probably very familiar with the process of manually installing dependencies, using ./configure, make and make install. Well, now that process has become easier. As of v1.6, OLS now ships with a build.sh script which handles dependencies, ./configure, and make for you. Simply run the build script, check/change the settings in ols.conf, and then run ./install.sh. That is it!

Page Contents

Build

Run build.sh to install dependencies, configure and make:

./build.sh

Check

Check the options via the # cat ols.conf command, and modify them if necessary. Update the WebAdmin Console password, OPENLSWS_PASSWORD, if you prefer to define your own password instead of accepting a randomly generated one.


#If you want to change the default values, please update this file.
#

SERVERROOT=/usr/local/lsws
OPENLSWS_USER=nobody
OPENLSWS_GROUP=nobody
OPENLSWS_ADMIN=admin
OPENLSWS_EMAIL=root@localhost
OPENLSWS_ADMINSSL=yes
OPENLSWS_ADMINPORT=7080
USE_LSPHP7=yes
DEFAULT_TMP_DIR=/tmp/lshttpd
PID_FILE=/tmp/lshttpd/lshttpd.pid
OPENLSWS_EXAMPLEPORT=8088

#You can set password here
#OPENLSWS_PASSWORD=

As of v1.6.5, an OLS WebAdmin Console password will be randomly generated if one is not specified in OPENLSWS_PASSWORD=. Previously 123456 was used if a password was not specified. The randomly generated password can be retrieved in /usr/local/lsws/adminpassword, and will also be shown on screen after installation completes. The ols.conf will be removed after successful installation.

Install

Run install.sh to complete OpenLiteSpeed installation:

./install.sh