Skip to content

Upgrade and Downgrade

Always back up your configuration before upgrading.

Terminal window
# Create a timestamped backup
tar czf /root/ols-backup-$(date +%Y%m%d).tar.gz /usr/local/lsws/conf/

This preserves httpd_config.conf, all virtual host configs, SSL settings, and module configurations.

Terminal window
/usr/local/lsws/bin/lshttpd -v
Terminal window
dnf update openlitespeed
systemctl restart lsws
Terminal window
apt update
apt upgrade openlitespeed
systemctl restart lsws

The package manager preserves your existing configuration files. If a config file has been modified locally, you may be prompted to keep your version or install the package maintainer’s version. Keep your version unless you know the new default is required.

If you built from source:

Terminal window
cd openlitespeed
git pull
bash build.sh
cd dist
bash install.sh
/usr/local/lsws/bin/lswsctrl restart

The install script detects an existing installation and preserves configuration files.

On RPM-based systems, use dnf downgrade:

Terminal window
# List available versions
dnf --showduplicates list openlitespeed
# Downgrade to a specific version
dnf downgrade openlitespeed-1.7.19
systemctl restart lsws

On Debian-based systems:

Terminal window
# List available versions
apt-cache showpkg openlitespeed
# Install a specific version
apt install openlitespeed=1.7.19-1
systemctl restart lsws

Check out the desired tag and rebuild:

Terminal window
cd openlitespeed
git checkout v1.7.19
bash build.sh
cd dist
bash install.sh
/usr/local/lsws/bin/lswsctrl restart

If an upgrade causes problems, restore your configuration backup:

Terminal window
# Stop the server
systemctl stop lsws
# Restore config
tar xzf /root/ols-backup-YYYYMMDD.tar.gz -C /
# Restart
systemctl start lsws
Terminal window
# Check version
/usr/local/lsws/bin/lshttpd -v
# Check server status
/usr/local/lsws/bin/lswsctrl status
# Review error log for startup issues
tail -50 /usr/local/lsws/logs/error.log