Upgrading/Downgrading OpenLiteSpeed

How Can We Help?
< Back
You are here:
Print

There are three different methods for upgrading or downgrading your version of OpenLiteSpeed:

  1. LiteSpeed repository
  2. lsup.sh script
  3. Binary install

In order to avoid complications, always upgrade or downgrade using the same method you used to install OpenLiteSpeed originally.

NOTE: If you are using OLS on DirectAdmin, please don’t use any of these methods. Please see How to Upgrade OLS on DirectAdmin.

When installing OpenLiteSpeed through LiteSpeed repository,  it is generally available in two branches: the stable branch, and the edge branch. The normal LiteSpeed repository only keeps versions of the stable branch available. For example, at the time of this writing, the latest OpenLiteSpeed version is 1.7.19, but only versions in the 1.6.x branch are available in the LiteSpeed repository. In order to upgrade to the latest version in the edge branch, you will need to enable the LiteSpeed edge tier repository. Otherwise, OpenLiteSpeed might be accidentally downgraded to the latest 1.6.x version if 1.7.x was previously installed through the binary install. (Reminder: binary install should not be mixed with repository installation, but it does sometimes happen accidentally).

Method 1: LiteSpeed Repository

If you installed OpenLiteSpeed through the LiteSpeed repository before, you should simply run the package update command.

CentOS Upgrade

yum update openlitespeed

CentOS Downgrade

You can downgrade to any specific version that the repository supports.

  1. Find all of the available versions from the repository
    yum --showduplicates list openlitespeed
  2. Run the downgrade command with the version you need
    yum downgrade openlitespeed-1.7.19

Debian & Ubuntu Upgrade

apt-get upgrade openlitespeed

Note: If you previously installed the OLS stable tier, and you wish to upgrade to the edge tier, please enable the LiteSpeed edge repo.

Debian & Ubuntu Downgrade

Downgrade to a version from the history list

  1. Find all of the installed available versions from apt
    apt-cache policy openlitespeed
  2. Run the downgrade command with the version you need
    apt install openlitespeed=1.7.19-3+jammy

Downgrade to any specific version that the repository supports

  1. Search available OpenLitespeed versions from repository
  2. Download the specific version, e.g. openlitespeed_1.7.19-3+jammy_amd64.deb package
    wget https://rpms.litespeedtech.com/debian/pool/main/jammy/openlitespeed_1.7.19-3%2Bjammy_amd64.deb
  3. Install the package
    dpkg -i openlitespeed_1.7.19-3+jammy_amd64.deb

Method 2: lsup.sh Script

Note: Please don’t use the lsup.sh script if you installed OLS through the LiteSpeed repository. In that case, you should continue to use package management commands to upgrade OLS.

The lsup.sh script works similarly to the LiteSpeed Enterprise lsup.sh script, and allows you to upgrade or downgrade OLS to a particular version.

You can download the latest lsup.sh through:

wget https://raw.githubusercontent.com/litespeedtech/openlitespeed/master/dist/admin/misc/lsup.sh

Note: If you wish to use lsup,sh, you must have installed OpenLiteSpeed via binary install or source code install. It cannot have been installed through yum or apt-get. If you did install OLS through yum or apt-get, you will need to uninstall it through package management, and reinstall through binary or source code installation before using lsup.sh.

Running ./lsup.sh will update to the latest stable version, and ./lsup.sh -d will update to the latest stable DEBUG version.

Additionally, these options are available:

Usage: lsup.sh [-t] | [-c] | [[-d] [-r] | [-v VERSION]] | [-e VERSION]
  -a
     Update web admin password
  -d
     Choose Debug version to upgrade or downgrade, will do clean like -c at the same time.
  -v VERSION
     If VERSION is given, this command will install the specified VERSION. Otherwise, it will get the latest version from /usr/local/lsws/autoupdate/release.
  -e VERSION 
     Upgrade/downgrade to specified VERSION without making any other changes. The version listed in /usr/local/lsws/VERSION does not change.
  -r 
     Restore the originally installed version which is in file VERSION.
  -p
     Restore the previously installed version which was renamed to .old files.
  -t
     To test openlitespeed running status.
  -c
     Do some cleanup and restart openlitespeed service.
  -h | --help     
     Display this help and exit.
  -g 
     Toggle DEBUG log

lsup.sh is not only a very powerful tool to upgrade/downgrade OLS, but also an installation tool if OLS has not yet been installed on the server.

To test a particular version temporarily, use the -e VERSION option, run your tests, and then use the -r option to restore the original version listed in /usr/local/lsws/VERSION.

Method 3: Binary Install

If you installed OLS by downloading the package and running ./install.sh, you will need to do the same to upgrade. For example, you could upgrade from 1.6.x to 1.7.19 like so:

wget https://openlitespeed.org/packages/openlitespeed-1.7.19.tgz
tar -zxvf openlitespeed-*.tgz
cd openlitespeed
./install.sh

Switch from Repo to Binary Installation

Most of the time, you should not need to switch from repo installation to binary or lsup.sh script installation, or vice versa. If you wish to do so for some reason, please do the following:

  1. Back up your entire OLS configuration.
  2. Uninstall OLS through yum or apt-get, as appropriate, to avoid accidentally downgrading in the future.
  3. Copy the OLS configuration backup to /usr/local/lsws/conf/.
  4. Download the latest binary package from https://openlitespeed.org/downloads/, unpack, and run ./install.sh. Alternatively, you can use the lsup.sh script.
Tags: