Upgrade and Downgrade
Before You Upgrade
Section titled “Before You Upgrade”Always back up your configuration before upgrading.
Back Up Configuration
Section titled “Back Up Configuration”# Create a timestamped backuptar 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.
Check Current Version
Section titled “Check Current Version”/usr/local/lsws/bin/lshttpd -vUpgrade via Repository
Section titled “Upgrade via Repository”AlmaLinux / Rocky Linux 9
Section titled “AlmaLinux / Rocky Linux 9”dnf update openlitespeedsystemctl restart lswsUbuntu / Debian
Section titled “Ubuntu / Debian”apt updateapt upgrade openlitespeedsystemctl restart lswsThe 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.
Upgrade via Source
Section titled “Upgrade via Source”If you built from source:
cd openlitespeedgit pullbash build.shcd distbash install.sh/usr/local/lsws/bin/lswsctrl restartThe install script detects an existing installation and preserves configuration files.
Downgrade
Section titled “Downgrade”Repository Downgrade
Section titled “Repository Downgrade”On RPM-based systems, use dnf downgrade:
# List available versionsdnf --showduplicates list openlitespeed
# Downgrade to a specific versiondnf downgrade openlitespeed-1.7.19systemctl restart lswsOn Debian-based systems:
# List available versionsapt-cache showpkg openlitespeed
# Install a specific versionapt install openlitespeed=1.7.19-1systemctl restart lswsSource Downgrade
Section titled “Source Downgrade”Check out the desired tag and rebuild:
cd openlitespeedgit checkout v1.7.19bash build.shcd distbash install.sh/usr/local/lsws/bin/lswsctrl restartRestore from Backup
Section titled “Restore from Backup”If an upgrade causes problems, restore your configuration backup:
# Stop the serversystemctl stop lsws
# Restore configtar xzf /root/ols-backup-YYYYMMDD.tar.gz -C /
# Restartsystemctl start lswsVerify After Upgrade
Section titled “Verify After Upgrade”# Check version/usr/local/lsws/bin/lshttpd -v
# Check server status/usr/local/lsws/bin/lswsctrl status
# Review error log for startup issuestail -50 /usr/local/lsws/logs/error.logNext Steps
Section titled “Next Steps”- Basic Configuration — review configuration after upgrading.
- Logs — check logs for any post-upgrade issues.