f79753feb1
Changes: - Condensed Backup & Recovery section from 14 lines to 5 lines - Removed detailed Acronis sub-bullets (was overstated) - Condensed directory structure: 15 Acronis script lines → 1 line - Balanced coverage between Acronis and MySQL restore tool - Kept essential info without excessive detail Before: 14 bullet points for Acronis After: 1 line for Acronis, cleaner overview
292 lines
12 KiB
Markdown
292 lines
12 KiB
Markdown
# ⚡ Linux Server Management Toolkit
|
|
|
|
Comprehensive multi-panel server management suite supporting cPanel, InterWorx, Plesk, and standalone Apache 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
|
|
│ │
|
|
│ ├── diagnostics/ # 🔍 System Diagnostics
|
|
│ │ ├── system-health-check.sh # Comprehensive health analysis
|
|
│ │ └── loadwatch-analyzer.sh # System health from loadwatch monitoring logs
|
|
│ │
|
|
│ ├── 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-*.sh # Acronis Cyber Protect (9 management scripts)
|
|
│ │ └── mysql-restore-to-sql.sh # MySQL/MariaDB database restore & dump tool
|
|
│ │
|
|
│ ├── website/ # 🌐 Website Diagnostics & Troubleshooting
|
|
│ │ ├── website-error-analyzer.sh # Comprehensive website error analysis
|
|
│ │ └── 500-error-tracker.sh # Track and analyze 500 errors
|
|
│ │
|
|
│ ├── diagnostics/ # 🔍 System Diagnostics & Log Analysis
|
|
│ │ ├── system-health-check.sh # Comprehensive health analysis
|
|
│ │ └── loadwatch-analyzer.sh # System health monitoring from loadwatch logs
|
|
│ │
|
|
│ ├── performance/ # 📊 Performance Analysis
|
|
│ │ ├── 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!)
|
|
│ │ └── (other performance modules)
|
|
│ │
|
|
│ └── 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
|
|
│ ├── php-detector.sh # PHP configuration detection (NEW!)
|
|
│ ├── php-analyzer.sh # PHP performance analysis engine (NEW!)
|
|
│ └── php-config-manager.sh # PHP config backup/restore/modification (NEW!)
|
|
│
|
|
├── 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:**
|
|
```bash
|
|
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:
|
|
```bash
|
|
source /root/linux-server-management-toolkit/run.sh
|
|
```
|
|
|
|
## ✨ Key Features
|
|
|
|
### 🛡️ Security & Monitoring
|
|
- **Bot & Traffic Analyzer**: Full bot/threat analysis with pattern detection
|
|
- **Live Attack Monitor**: Real-time SOC dashboard with threat classification
|
|
- **Specialized Monitors**: SSH attacks, web traffic, firewall activity
|
|
- **IP Reputation Manager**: Centralized cross-module IP intelligence with query/tracking
|
|
- **Malware Scanner**: ImunifyAV, ClamAV, and Maldet integration
|
|
- **cPHulk Integration**: Auto-imports CSF whitelists from all sources
|
|
- **Log Viewers**: Live tail for Apache access/error, mail, and security logs
|
|
- **Optimized Status Checks**: Uses cached domain status (no redundant HTTP requests)
|
|
|
|
### 💾 Backup & Recovery
|
|
- **Acronis Cyber Protect**: Complete agent management (install, update, configure, monitor, troubleshoot)
|
|
- **MySQL Database Restore Tool**: Advanced recovery from file-based backups with intelligent Force Recovery
|
|
- Multi-control panel support (cPanel, InterWorx, Plesk, standalone)
|
|
- Smart detection for selective restore scenarios
|
|
- Safe single-database extraction from full backups
|
|
- Clean SQL export for production import
|
|
|
|
### 🌐 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 & Performance Monitoring
|
|
- **Comprehensive Health Checks**: Hardware, services, security posture
|
|
- **Loadwatch Health Analyzer**: Historical system health analysis from monitoring logs
|
|
- Time-range analysis: 1h, 6h, 24h, 7d, 30d
|
|
- Memory pressure detection and swap usage trending
|
|
- CPU saturation analysis (idle, iowait, steal time)
|
|
- Process issue detection (zombies, high CPU/MEM consumers)
|
|
- MySQL performance monitoring
|
|
- Actionable recommendations based on findings
|
|
- **PHP Configuration Optimizer** (NEW!): Per-domain PHP optimization
|
|
- Analyzes PHP-FPM pool configurations across all domains
|
|
- Detects max_children issues from 7-day error log history
|
|
- OPcache hit rate analysis and tuning recommendations
|
|
- Memory limit optimization based on actual usage
|
|
- Auto-backup before changes with rollback capability
|
|
- Graceful PHP-FPM reload for zero downtime
|
|
- Supports cPanel, InterWorx, Plesk, standalone Apache
|
|
- **Smart Recommendations**: Context-aware suggestions based on findings
|
|
- **Multi-Panel Support**: cPanel, InterWorx, Plesk, standalone Apache
|
|
|
|
### 📊 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
|
|
|
|
### Quick System Health Check
|
|
|
|
```bash
|
|
bash launcher.sh
|
|
# Select: 1) System Health Check
|
|
```
|
|
|
|
### Security Analysis & Monitoring
|
|
|
|
```bash
|
|
bash launcher.sh
|
|
# Select: 2) Security & Monitoring
|
|
# Options:
|
|
# - Bot & Traffic Analyzer (full scan or 1-hour quick scan)
|
|
# - Live Attack Monitor (unified threat intelligence)
|
|
# - SSH/Web/Firewall attack monitors
|
|
# - IP Reputation Manager
|
|
# - Malware Scanner
|
|
# - Enable cPHulk Protection
|
|
```
|
|
|
|
### Website Diagnostics
|
|
|
|
```bash
|
|
bash launcher.sh
|
|
# Select: 3) Website Diagnostics
|
|
# Options:
|
|
# - Website Error Analyzer (comprehensive error detection)
|
|
# - Fast 500 Error Tracker (500 errors only)
|
|
# - WordPress Tools (WP-Cron manager)
|
|
```
|
|
|
|
### Performance Analysis
|
|
|
|
```bash
|
|
bash launcher.sh
|
|
# Select: 4) Performance Analysis
|
|
# Options:
|
|
# - MySQL Query Analyzer (slow query detection)
|
|
# - Network & Bandwidth Analyzer
|
|
# - Hardware Health Check
|
|
# - PHP Configuration Optimizer (per-domain tuning)
|
|
# - Loadwatch Health Analyzer (1h/6h/24h/7d/30d analysis)
|
|
```
|
|
|
|
### Backup & Recovery
|
|
|
|
```bash
|
|
bash launcher.sh
|
|
# Select: 5) Backup & Recovery
|
|
# Options:
|
|
# - Acronis Management (complete backup interface)
|
|
# - MySQL File Restore (convert DB files to SQL)
|
|
```
|
|
|
|
## 🔧 Configuration
|
|
|
|
Edit the configuration file:
|
|
```bash
|
|
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)
|
|
|
|
### December 2025 - Major Cleanup & Optimization
|
|
|
|
#### Launcher Streamlined (NEW!)
|
|
- ✅ Removed 90+ phantom menu items pointing to non-existent scripts
|
|
- ✅ Reduced from 1,576 lines to 574 lines (64% reduction)
|
|
- ✅ Cleaned up 7-level nested menus to 3 levels maximum
|
|
- ✅ Every menu item now points to a real, working script
|
|
- ✅ Faster navigation and no more "module not found" errors
|
|
- ✅ Main menu: 6 categories, 41 total working options
|
|
|
|
#### Performance Optimizations
|
|
- ✅ Bot analyzer now uses cached domain status (eliminates redundant HTTP checks)
|
|
- ✅ Saves ~5 minutes on 50-domain servers (no more curl requests per check)
|
|
- ✅ All modules use centralized reference database for domain status
|
|
- ✅ 1-hour cache prevents wasteful re-checking
|
|
|
|
#### MySQL/MariaDB Database Restore Tool
|
|
- ✅ Advanced database recovery from file-based backups
|
|
- ✅ Multi-control panel support (cPanel, InterWorx, Plesk, standalone)
|
|
- ✅ Intelligent Force Recovery with smart detection
|
|
- ✅ Safe selective restore (single DB from full backup, zero data loss)
|
|
- ✅ InterWorx path fix (/chroot/home instead of /home symlink)
|
|
- ✅ SQL output saved to restore directory parent (not control panel dirs)
|
|
- ✅ Safety features: disk space validation, directory protection, recovery warnings
|
|
|
|
#### Documentation Updates
|
|
- ✅ Main README updated with streamlined menu structure
|
|
- ✅ New modules/backup/README.md (comprehensive backup tools documentation)
|
|
- ✅ Updated usage examples to match new launcher
|
|
- ✅ All recent features documented
|
|
|
|
### Multi-Control Panel Support
|
|
- ✅ Full cPanel support (primary platform - production ready)
|
|
- ✅ InterWorx support (validated on real servers - production ready)
|
|
- ✅ Plesk support (validated on real servers - production ready)
|
|
- ✅ Standalone Apache support (basic functionality)
|
|
- ✅ 41 modules refactored for multi-panel architecture
|
|
- ✅ All critical paths verified on production systems
|
|
|
|
### Core Features Implemented
|
|
|
|
**Security & Monitoring (14 tools)**
|
|
- Bot & Traffic Analyzer (full + quick scan)
|
|
- Live Attack Monitor + 3 specialized monitors
|
|
- IP Reputation Manager
|
|
- Malware Scanner
|
|
- 4x Log tail viewers
|
|
- cPHulk enablement
|
|
- CT_LIMIT optimization
|
|
|
|
**Website Diagnostics (3 tools)**
|
|
- Website Error Analyzer
|
|
- Fast 500 Error Tracker
|
|
- WordPress Tools (WP-Cron manager)
|
|
|
|
**Performance Analysis (5 tools)**
|
|
- MySQL Query Analyzer
|
|
- Network & Bandwidth Analyzer
|
|
- Hardware Health Check
|
|
- PHP Configuration Optimizer
|
|
- Loadwatch Health Analyzer
|
|
|
|
**Backup & Recovery (11 tools)**
|
|
- Complete Acronis Cyber Protect integration (9 scripts)
|
|
- MySQL/MariaDB database restore
|
|
- Cleanup toolkit data
|
|
|
|
### System Infrastructure
|
|
- ✅ Reference database for cross-module intelligence (.sysref with 1-hour cache)
|
|
- ✅ Automatic control panel detection (system-detect.sh)
|
|
- ✅ Multi-panel user/domain management (user-manager.sh)
|
|
- ✅ Cached domain status checks (eliminates redundant HTTP requests)
|
|
- ✅ Zero hardcoded paths - all detection-based
|
|
|
|
## 🙏 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
|