7417fdd7d496a8a4fdf76dac764348fa22051044
USER REQUEST: "you have to confirm it will check for all of the sites? as it effects them all" PROBLEM: CT_LIMIT affects ALL sites on server, but optimizer only looked at aggregate traffic, not individual site requirements SOLUTION: Added comprehensive per-site analysis using sysref database NEW CAPABILITIES: 1. AUTO-DISCOVERS ALL SITES - Reads sysref database (auto-generated at launcher startup) - Gets all domains, document roots, and log paths - Confirms: "Per-Site Analysis (All X Sites Checked)" 2. DETECTS SITE TYPE FOR EACH DOMAIN - WordPress (checks WP database entries) - Ecommerce (WooCommerce, Magento indicators) - Framework (Composer/vendor detection) - Dynamic (50+ PHP files) - Moderate (5-50 PHP files) - Static (minimal PHP) 3. CALCULATES SITE COMPLEXITY SCORE (1-10) Factors: - WordPress: +3 base + (plugins/5) - Ecommerce: +5 (shopping cart needs many connections) - Framework/Dynamic: +2 - Ajax-heavy (20+ .js files): +2 - Result: Higher score = needs more CT_LIMIT headroom 4. ANALYZES TRAFFIC PER DOMAIN - Max concurrent connections per site - Unique IPs per site - Total requests per site - Separated from aggregate analysis 5. FACTORS COMPLEXITY INTO RECOMMENDATIONS - Average complexity across all sites - Complexity buffer added to recommendations - Ecommerce sites get +15/+10 buffer - Formula: CT_LIMIT = max_legit + buffer + complexity_factor 6. DISPLAYS PER-SITE BREAKDOWN ``` Per-Site Analysis (All 3 Sites Checked): DOMAIN TYPE CMPLX MAX_CONN UNIQ_IPs ──────────────────────────────────────────────────────────────────── example.com wordpress 7 45 128 shop.example.com ecommerce 9 82 245 static.example.com static 1 8 34 ⚠️ 2 high-complexity sites detected (WordPress/Ecommerce/Framework - need higher CT_LIMIT) ``` EXAMPLE RECOMMENDATION ADJUSTMENT: BEFORE (no site analysis): - BALANCED: CT_LIMIT = 65 AFTER (with 2 WordPress sites, 1 ecommerce): - Average complexity: 7 - Complexity buffer: 7 * 2 = 14 - Ecommerce bonus: +10 - BALANCED: CT_LIMIT = 89 - Reason: "Accounts for WordPress admin/Ajax + ecommerce checkout" INTELLIGENCE: ✅ Knows WordPress admin needs more connections ✅ Knows ecommerce checkout = simultaneous AJAX calls ✅ Knows static sites need minimal limits ✅ Knows Ajax-heavy sites (React/Vue) need headroom ✅ Accounts for plugin count (more plugins = more connections) CONFIRMATION FOR USER: Report clearly shows: "Per-Site Analysis (All X Sites Checked)" Where X = actual number of sites discovered from sysref database SAFETY: - If sysref.db doesn't exist, builds it automatically - Skips aliases (only analyzes primary domains) - Skips unknown/system domains - Only analyzes sites with actual log files FUNCTIONS ADDED: - detect_site_type() - WordPress/ecommerce/framework detection - calculate_site_complexity() - 1-10 score based on site needs - analyze_per_site_traffic() - Per-domain traffic breakdown - Enhanced generate_recommendation() - Factors in complexity FILES MODIFIED: - modules/security/optimize-ct-limit.sh - Added reference-db.sh sourcing (line 19) - Added detect_site_type() (lines 54-92) - Added calculate_site_complexity() (lines 94-136) - Added analyze_per_site_traffic() (lines 138-183) - Enhanced generate_recommendation() (lines 368-408, 449-465) - Added per-site analysis call in main() (line 625) RESULT: ✅ Confirms ALL sites checked ✅ Tailors CT_LIMIT to actual site portfolio ✅ Prevents blocking legitimate WordPress/ecommerce traffic ✅ Shows exactly which sites drive the requirement
⚡ Linux Server Management Toolkit
Comprehensive cPanel/Linux server management suite with modular architecture and intelligent security features.
📦 Directory Structure
server-toolkit/
├── launcher.sh # Main menu system
├── README.md # This file
│
├── modules/ # Modular scripts organized by category
│ │
│ ├── security/ # 🛡️ Security & Threat Analysis
│ │ ├── bot-analyzer.sh # Full bot/threat analysis
│ │ ├── live-attack-monitor.sh # Real-time attack monitoring dashboard
│ │ ├── ssh-attack-monitor.sh # SSH brute force detection
│ │ ├── web-traffic-monitor.sh # Web traffic monitoring
│ │ ├── firewall-activity-monitor.sh # CSF/iptables monitoring
│ │ ├── enable-cphulk.sh # cPHulk enablement with CSF whitelist import
│ │ ├── ip-reputation-manager.sh # Centralized IP reputation tracking
│ │ └── tail-*.sh # Various log monitoring scripts
│ │
│ ├── backup/ # 💾 Backup & Recovery (Acronis Cyber Protect)
│ │ ├── acronis-backup-manager.sh # Main backup management menu
│ │ ├── acronis-install.sh # Install Acronis agent
│ │ ├── acronis-update.sh # Update Acronis agent
│ │ ├── acronis-uninstall.sh # Uninstall Acronis agent
│ │ ├── acronis-register.sh # Register agent with cloud
│ │ ├── acronis-configure.sh # Configure agent settings
│ │ ├── acronis-agent-status.sh # Comprehensive agent status check
│ │ ├── acronis-trigger-backup.sh # Trigger manual backups with optimizations
│ │ ├── acronis-backup-status.sh # Check backup job status
│ │ ├── acronis-list-backups.sh # List all backups
│ │ ├── acronis-plan-manager.sh # Manage protection plans
│ │ ├── acronis-schedule-viewer.sh # View backup schedules
│ │ ├── acronis-restore.sh # Restore from backup
│ │ ├── acronis-logs.sh # View Acronis logs
│ │ └── acronis-troubleshoot.sh # Troubleshoot common issues
│ │
│ ├── website/ # 🌐 Website Diagnostics & Troubleshooting
│ │ ├── website-error-analyzer.sh # Comprehensive website error analysis
│ │ └── 500-error-tracker.sh # Track and analyze 500 errors
│ │
│ ├── diagnostics/ # 🔍 System Diagnostics
│ │ └── system-health-check.sh # Comprehensive health analysis
│ │
│ ├── performance/ # 📊 Performance Analysis
│ │ ├── hardware-health-check.sh # Hardware diagnostics
│ │ ├── mysql-query-analyzer.sh # MySQL performance analysis
│ │ └── network-bandwidth-analyzer.sh # Network analysis
│ │
│ └── maintenance/ # 🧹 System Maintenance
│ └── cleanup-toolkit-data.sh # Clean temporary toolkit data
│
├── lib/ # Shared libraries
│ ├── common-functions.sh # Reusable functions
│ ├── system-detect.sh # System type detection
│ ├── user-manager.sh # User account management
│ ├── mysql-analyzer.sh # MySQL utilities
│ └── reference-db.sh # Cross-module intelligence sharing
│
├── config/ # Configuration files
│ ├── settings.conf # Main configuration
│ ├── whitelist-ips.txt # IP whitelist
│ └── whitelist-user-agents.txt # User-Agent whitelist
│
└── tools/ # Utility scripts
├── diagnostic-report.sh # Generate system reports
└── test-*.sh # Testing utilities
🚀 Quick Start
Installation & Running
One command - automatic cleanup:
curl -sL https://git.mull.lol/cschantz/Linux-Server-Management-Toolkit/archive/main.tar.gz | tar xz && source linux-server-management-toolkit/run.sh
When exiting (option 0), answer "yes" and cleanup happens automatically - no extra steps.
Or if already downloaded:
source /root/server-toolkit/run.sh
✨ Key Features
🛡️ Security & Threat Analysis
- 3-Mode Security Menu: Analysis / Actions / Live Monitoring
- Live Attack Monitor: Real-time SOC dashboard with threat classification
- Intelligent cPHulk Setup: Auto-imports CSF whitelists from all sources
- IP Reputation Tracking: Centralized cross-module IP intelligence
- Multi-Source Monitoring: SSH, Web, Firewall, cPHulk integration
💾 Backup & Recovery (Acronis Cyber Protect)
- Complete Agent Management: Install, update, uninstall, register
- Comprehensive Status Monitoring: Agent health, registration, cloud connectivity
- Manual Backup Triggering: CLI-managed plans with performance optimizations
- Backup Type Selection: Full, Incremental, Differential backups
- Plan Management: View, enable/disable, delete protection plans
- Restore Operations: Full restore capabilities from backups
- Troubleshooting Tools: Log viewing and automated diagnostics
🌐 Website Diagnostics
- Error Analysis: Comprehensive website error detection and troubleshooting
- 500 Error Tracking: Detailed analysis of application errors
- Log Integration: Apache, PHP-FPM, cPanel error log analysis
- Smart Recommendations: Context-aware suggestions for fixing issues
🔍 System Diagnostics
- Comprehensive Health Checks: Hardware, services, security posture
- Smart Recommendations: Context-aware suggestions based on findings
- cPanel/WHM Integration: Native support for cPanel environments
📊 Session Intelligence
- Reference Database: Cross-module data sharing (.sysref)
- No Historical Tracking: Session-based intelligence only
- "Download, Run, Fix, Delete": Designed for one-time troubleshooting
🎯 Usage Examples
Security Analysis with Live Monitoring
bash launcher.sh
# Select: Security & Threat Analysis
# Select: Live Monitoring & Alerts
# Select: Live Network Security Monitor
Enable cPHulk with CSF Whitelist
bash launcher.sh
# Select: Security & Threat Analysis
# Select: Security Actions & Fixes
# Select: Authentication Security
# Select: Enable cPHulk Protection
Acronis Backup Management
bash launcher.sh
# Select: Backup & Recovery
# Select: Check Agent Status (view health, registration, connectivity)
# Select: Trigger Manual Backup (with type selection and optimizations)
# Select: Manage Protection Plans
Website Error Analysis
bash launcher.sh
# Select: Website Diagnostics & Troubleshooting
# Select: Website Error Analyzer
# Choose a cPanel user account to analyze
System Health Check
bash launcher.sh
# Select: System Diagnostics
# Select: System Health Check
🔧 Configuration
Edit the configuration file:
nano /root/server-toolkit/config/settings.conf
🔒 Security Considerations
- Run as root: Most modules require root access
- Credentials stored safely: Git credentials in ~/.git-credentials (outside project)
- No sensitive data in repo: .gitignore excludes keys, tokens, credentials
- Test first: Try on non-production environments first
📊 Recent Updates (v2.1)
Backup & Recovery
- ✅ Complete Acronis Cyber Protect integration (16 management scripts)
- ✅ Agent installation, registration, and update automation
- ✅ Comprehensive status monitoring (health, registration, connectivity)
- ✅ Manual backup triggering with performance optimizations
- ✅ Backup type selection (Full/Incremental/Differential)
- ✅ Protection plan management and scheduling
Website Diagnostics
- ✅ Comprehensive website error analyzer
- ✅ 500 error tracking and troubleshooting
- ✅ Multi-log integration (Apache, PHP-FPM, cPanel)
- ✅ Smart error detection and recommendations
Security Enhancements
- ✅ Centralized IP reputation tracking across modules
- ✅ Complete security menu restructure (3-mode hierarchy)
- ✅ Live network security monitoring dashboard
- ✅ Intelligent cPHulk enablement with multi-source CSF whitelist discovery
- ✅ Real-time threat detection and classification
Core Infrastructure
- ✅ Reference database for cross-module intelligence
- ✅ Git repository integration with auto-commit workflows
- ✅ Modular architecture with organized category structure
🙏 Credits
Built for comprehensive cPanel/Linux server management with a focus on security and intelligent automation.
Version: 2.1.0 Repository: https://git.mull.lol/cschantz/Linux-Server-Management-Toolkit
Languages
Shell
100%