Updating OpenLiteSpeed
Learning Focus
By the end of this lesson you will know how to upgrade OpenLiteSpeed safely using packages, verify the upgrade succeeded, and maintain a rollback plan.
Why Keeping OpenLiteSpeed Updated Matters
Updates include security patches, bug fixes, and performance improvements. Running outdated versions exposes the server to known vulnerabilities.
Pre-Upgrade Checklist
Before upgrading, always prepare:
| Step | Command | Why |
|---|---|---|
| Backup config | sudo cp -r /usr/local/lsws/conf /usr/local/lsws/conf.bak | Rollback if the upgrade breaks config |
| Note current version | /usr/local/lsws/bin/lshttpd -v | Know what you are upgrading from |
| Check release notes | Visit OpenLiteSpeed releases | Identify breaking changes |
| Backup SSL certs | sudo cp -r /etc/ssl/private /etc/ssl/private.bak | Certificate references may change |
| Plan maintenance window | Schedule during low traffic | Minimize user impact |
Upgrade Process
On Debian / Ubuntu
# 1) Update package lists
sudo apt update
# 2) Check available version
apt policy openlitespeed
# 3) Upgrade
sudo apt upgrade openlitespeed
# 4) Restart the server (upgrade usually requires full restart)
sudo systemctl restart lsws
# 5) Verify the new version
/usr/local/lsws/bin/lshttpd -v
On RHEL / AlmaLinux / Rocky
# 1) Check for updates
sudo dnf check-update openlitespeed
# 2) Upgrade
sudo dnf upgrade openlitespeed
# 3) Restart
sudo systemctl restart lsws
# 4) Verify
/usr/local/lsws/bin/lshttpd -v
Post-Upgrade Verification
# Check the service is running
sudo systemctl status lsws
# Check the error log for startup warnings
tail -30 /usr/local/lsws/logs/error.log
# Test the default page
curl -I http://localhost
# Test WebAdmin access
curl -kI https://localhost:7080
# Verify SSL still works
openssl s_client -connect localhost:443 -servername example.com </dev/null 2>/dev/null | head -5
Rollback Plan
If the upgrade causes issues:
# 1) Stop the server
sudo systemctl stop lsws
# 2) Restore the config backup
sudo cp -r /usr/local/lsws/conf.bak/* /usr/local/lsws/conf/
# 3) If the binary itself is broken, downgrade the package
sudo apt install openlitespeed=PREVIOUS_VERSION # Debian/Ubuntu
sudo dnf downgrade openlitespeed # RHEL family
# 4) Restart
sudo systemctl start lsws
warning
An upgrade plan should always include validation steps and a rollback path. Never upgrade production during peak traffic without a plan.
Key Takeaways
- Always backup config before upgrading —
conf.bakcan save you from a bad upgrade. - Check release notes for breaking changes before running
apt upgrade. - Verify after every upgrade with service status, error log, and test requests.
- Keep a rollback plan ready for every production upgrade.
What's Next
- Continue to Updating lsphp to keep your PHP runtime current.