[FREE] cPFence OLS Freeze for Enhance v12

Hey Everyone ,
This is cPFence OLS Freeze updated for Enhance v12 , a free script for Enhance Control Panel users who want their OpenLiteSpeed (OLS) settings to survive vhost rebuilds.
This remains a standalone free script; it does not require a cPFence license. Use administrator SSH access with root/sudo on the intended host-based Enhance OLS server. The pinned script targets Ubuntu 24.04 and expects /usr/local/lsws/conf/httpd_config.conf and the lshttpd service.
Keep an independent configuration backup and read the pinned script before running it. Remove the old script’s cron entry if you are moving from our original cron-based version; do not run two OLS freeze managers together.
How to use
Unfreeze first, then make your intended OLS or WAF changes. This stops enforcement and clears the saved freeze state; it does not restore an old configuration:
curl -fsSL https://gist.githubusercontent.com/cPFence/041ef1ba10a41d62bd2a4d6cee2dae41/raw/d9cb49df93b32cce677c87f38435078f8620679d/cPFence_ols_freeze.sh \
-o /tmp/cPFence_ols_freeze.sh && chmod +x /tmp/cPFence_ols_freeze.sh && sudo /tmp/cPFence_ols_freeze.sh unfreeze
Freeze OLS config:
curl -fsSL https://gist.githubusercontent.com/cPFence/041ef1ba10a41d62bd2a4d6cee2dae41/raw/d9cb49df93b32cce677c87f38435078f8620679d/cPFence_ols_freeze.sh \
-o /tmp/cPFence_ols_freeze.sh && chmod +x /tmp/cPFence_ols_freeze.sh && sudo /tmp/cPFence_ols_freeze.sh freeze
It installs a small systemd path + timer and enforces the saved server-level configuration when Enhance touches it, preserving the current vhost section. Enforcement can restart OLS. After freezing, check cpf_ols_freeze.path and cpf_ols_freeze.timer with systemctl status, and read journalctl -u cpf_ols_freeze.service for errors. An enabled timer alone does not prove a successful restore.
If you see repeated restarts or an incorrect result, run the unfreeze command above and check OLS and your websites before freezing again. The script keeps dated httpd_config_backup-*.conf files in /usr/local/lsws/conf/ and prunes older backups; keep a separate recovery copy.
Important
- Unfreeze before changing OLS or cPFence WAF settings
- Test this on a test server first
- Only use in production after you’re sure it behaves perfectly
Feedback welcome.
Try cPFence Free for One Month
Bring server protection and monitoring together with cPFence v4+ for Enhance on Ubuntu 22.04/24.04.
Start free trial

