Objective
This guide explains how to update the CyberPanel Main VirtualHost configuration using a script, back up the original configuration file, replace it with a new one, and restart the necessary services.
⚠️ Check for errors first:
/usr/local/lsws/bin/openlitespeed -t
Download & Execute Script
wget -qO- https://panelwebhosting.org/script/cyberpanel/cpvh.sh | bash
📥 Downloads the update script
⚡ Executes it immediately
🖥️ Prepares the server with the latest VirtualHost template
Backup Existing Configuration
mv /usr/local/lsws/conf/httpd_config.conf /usr/local/lsws/conf/httpd_config.conf_og
💾 Saves original config as httpd_config.conf_og
🛡️ Ensures safe rollback if needed
Replace with New Configuration
mv /usr/local/lsws/conf/httpd_config_new.conf /usr/local/lsws/conf/httpd_config.conf
🔄 Moves new config into place
✨ Replaces old configuration
✅ Make sure httpd_config_new.conf exists
Restart Web Server
systemctl restart lshttpd.service || systemctl restart lsws
🔁 Restarts `lshttpd.service` first
⚠️ Falls back to `lsws` if first fails
✅ Applies the new configuration
Verify & Rollback if Needed
🌐 Check if the website loads properly
❌ If issues occur, restore backup:
mv /usr/local/lsws/conf/httpd_config.conf_og /usr/local/lsws/conf/httpd_config.conf
🔄 Restart the web server to apply rollback:
systemctl restart lshttpd.service || systemctl restart lsws
✅ Conclusion
💾 Backup in place
🔁 Automatic service restart
⚡ Safe, minimal downtime update