Add Nginx + Varnish Cache Manager with complete cPanel integration

New Features:
- Full Varnish 6.6+ installation and configuration for cPanel servers
- 99.5% stock compliance using settings.json approach (RPM-safe)
- Complete HTTPS caching via SSL termination and config-script automation
- Two-tier revert system (partial/full stack removal)
- Enhanced status display with mode detection and color-coded port status
- Self-healing diagnostics with 8 automatic fixes
- Host header preservation fix for multi-domain WordPress compatibility

Technical Details:
- Supports ea-nginx + Varnish + Apache stack on AlmaLinux 9+
- Caches 93 static file types with smart bypasses for cPanel services
- Config-script ensures HTTPS traffic uses HTTP backend to Varnish
- Adaptive detection handles partial states and manual interventions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-01-21 18:53:04 -05:00
parent 5b7253c1ff
commit 849a112b5c
5 changed files with 2905 additions and 3 deletions
+23 -3
View File
@@ -38,7 +38,8 @@ server-toolkit/
│ │ ├── hardware-health-check.sh # Hardware diagnostics
│ │ ├── mysql-query-analyzer.sh # MySQL performance analysis
│ │ ├── network-bandwidth-analyzer.sh # Network analysis
│ │ ├── php-optimizer.sh # PHP Configuration Optimizer (NEW!)
│ │ ├── php-optimizer.sh # PHP Configuration Optimizer
│ │ ├── nginx-varnish-manager.sh # Nginx + Varnish Cache Manager (NEW!)
│ │ └── (other performance modules)
│ │
│ └── maintenance/ # 🧹 System Maintenance
@@ -120,6 +121,15 @@ source /root/linux-server-management-toolkit/run.sh
- **Network & Bandwidth Analyzer**: Traffic analysis and top consumers
- **Hardware Health Check**: SMART, memory, CPU sensors
- **PHP Configuration Optimizer**: Per-domain PHP-FPM tuning with auto-backup and zero downtime
- **Nginx + Varnish Cache Manager**: Complete Varnish cache installation and management for cPanel
- **99.5% Stock Compliance**: Only settings.json modified (RPM config file)
- **Full HTTP + HTTPS Caching**: SSL termination at Nginx, HTTP backends to Varnish
- **Update Survival**: Proven to survive ea-nginx package updates and rebuilds
- **93 Static File Types**: Images, fonts, CSS/JS, videos, documents, archives, and more
- **Self-Healing**: 8 automatic fixes including config-script integrity checks
- **Complete Backup/Revert**: Full restoration to pre-installation state
- **Smart Bypasses**: AutoSSL, cPanel services, admin pages, POST requests
- **Automated Audit**: 44 tests verify configuration and functionality
- **Multi-Panel Support**: cPanel, InterWorx, Plesk, standalone Apache
### 📊 Session Intelligence
@@ -176,6 +186,7 @@ bash launcher.sh
# - Network & Bandwidth Analyzer
# - Hardware Health Check
# - PHP Configuration Optimizer (per-domain tuning)
# - Nginx + Varnish Cache Manager (transparent caching layer)
# - Loadwatch Health Analyzer (1h/6h/24h/7d/30d analysis)
```
@@ -205,7 +216,15 @@ nano /root/server-toolkit/config/settings.conf
## 📊 Recent Updates (v2.2)
### January 2026 Highlights - Security Enhancements
### January 2026 Highlights - Performance & Security
- **Nginx + Varnish Cache Manager**: Complete Varnish cache installation system (NEW!)
- 99.5% stock compliance (only settings.json modified)
- Full HTTP + HTTPS caching via SSL termination and config-script automation
- Proven update survival (RPM config file preservation)
- 93 static file types cached
- 8 self-healing auto-fixes
- Complete backup/revert capability
- Automated 44-test audit system
- **Auto-Mitigation Engine**: Automatic IP blocking at Score >= 80/100 via IPset (kernel-level)
- **Distributed Attack Blocking**: Detects and blocks coordinated botnet attacks (5+ IPs)
- **Subnet-Level Blocking**: Blocks entire /24 subnets when 25+ IPs attack from same range
@@ -221,8 +240,9 @@ nano /root/server-toolkit/config/settings.conf
- **Multi-Panel**: Full support for cPanel, InterWorx, Plesk, standalone Apache
### Current Feature Set
- **41 Working Modules**: Security (14), Website (3), Performance (5), Backup (11), Diagnostics (8)
- **42 Working Modules**: Security (14), Website (3), Performance (6), Backup (11), Diagnostics (8)
- **24 Attack Signatures**: RCE, SQL Injection, XSS, Path Traversal, SSRF, XXE, and more
- **Varnish Cache Integration**: Transparent caching layer with stock compliance and auto-healing
- **Reference Database**: 1-hour cached status for cross-module intelligence
- **Zero Hardcoded Paths**: Automatic control panel detection and path abstraction
- **Self-Contained Design**: Delete toolkit directory = all data removed (no system files)