Understanding how cPanel functions requires looking at it in multiple interconnected layersβfrom the server OS up to the graphical user interface. Here’s a complete breakdown:
π§± 1. Operating System Layer (CentOS / AlmaLinux / CloudLinux)
- Role: The foundational layer that supports all other layers and services.
- Function: Provides the core system kernel, filesystem, networking, and resource management.
- cPanel Compatibility:
- CentOS 7 (EOL soon)
- AlmaLinux
- CloudLinux (preferred for multitenancy/resource isolation)
ποΈ 2. Service Layer (Core Web Services)
This is where the server runs essential services that make websites function.
βοΈ Email Services
- Exim: Mail transfer agent for sending/receiving emails.
- Dovecot: POP/IMAP server for email retrieval.
- SpamAssassin: Email spam filtering.
- Mailman: Mailing list management.
- cPHulk: Protects against brute-force attacks on services like SSH, WHM, and cPanel.
π Web Services
- Apache: Primary web server. Often integrated with NGINX or LiteSpeed for speed.
- NGINX (optional): Reverse proxy for caching/static content delivery.
- LiteSpeed (optional): Commercial drop-in replacement for Apache.
- PHP-FPM: Handles PHP execution with better performance.
- ModSecurity: Web application firewall (WAF) for Apache/NGINX.
π’οΈ Database Services
- MySQL / MariaDB: Relational database management systems (RDBMS).
- PostgreSQL (optional): Alternative RDBMS for specific applications.
π Security Services
- CSF (ConfigServer Firewall): Advanced firewall interface.
- ClamAV: Antivirus scanner (optional).
- Let’s Encrypt / AutoSSL: Automated SSL provisioning.
- Imunify360 (optional): Security and malware scanning.
π DNS Services
- BIND: Default DNS server for managing domain records.
- PowerDNS (optional): Alternative DNS backend with DNSSEC support.
βοΈ 3. Control Panel Services (The cPanel/WHM Daemons)
This layer powers the user interfaces and automation in cPanel/WHM.
- cpsrvd: cPanel web server daemon (HTTPS, handles login sessions).
- cpanellogd: Logs processing and stats collection.
- cphulkd: Monitors and defends against brute-force attacks.
- cpdavd: Handles WebDAV-based file management.
- queueprocd: Manages task queue for background processes.
- spamd: Daemon for SpamAssassin filtering.
π₯οΈ 4. Web Interface Layer
The graphical front-end for administrators, resellers, and users.
WHM (WebHost Manager)
- Access: Root / Reseller
- Function: Manages server configuration, package creation, account setup, service management.
cPanel (User Level)
- Access: End-users
- Function: Manage websites, domains, emails, files, databases, metrics, and backups.
Webmail
- Access: End-users
- Function: Roundcube/Horde (deprecated), handles email access via browser.
π 5. Automation & Integration Layer
These are systems that automate or enhance server and user experience.
- EasyApache: Rebuilds Apache/PHP stacks with desired modules.
- AutoSSL: Automatically provisions SSL certificates.
- Backup System: Automates full/incremental backups.
- Account Creation Scripts (XMLAPI/WHM API 1 & 2): Allows integration via third-party billing platforms (e.g., WHMCS).
- Hooks & Cron Jobs: Automate tasks at account or system level.
- Transfer Tools: Migrates accounts between cPanel servers.
- Git Integration: Pull code directly into the cPanel environment.
π§© 6. Extensions & Third-Party Integrations
- Softaculous: One-click app installer.
- Imunify360: Advanced security platform.
- JetBackup: Powerful backup solution.
- CloudLinux LVE Manager: Resource isolation and limits.
- WHMCS: Hosting billing automation platform.
βοΈ Process Flow (Simplified)
User Request β cPanel Interface β cpsrvd β Backend Service (Apache, MySQL, Exim, etc.) β Response
π Logging & Monitoring
- Log Files:
/var/log/*includes logs for Apache, Exim, cPanel, etc. - Top Tools:
top,htop: Resource usage.sar,vmstat: Performance stats.- WHM: GUI-based logs and metrics tools.
- Notifications: WHM alerts via email (e.g., high disk usage, failed backups, etc.).