File format · .whm

WHM & cPanel Configuration File Recovery and Repair Guide

WHM and cPanel configuration files store critical hosting account, DNS, and email data. Learn how these files become corrupted and how to repair them safel


When server administrators talk about a "WebHost Manager file," they are usually referring to the critical configuration, account, zone, and service-definition files that underpin a cPanel and WebHost Manager (WHM) environment. Because cPanel is one of the most widely used web hosting control panels—managing tens of millions of domains globally—the integrity of its underlying configuration files is essential. When these files become corrupted, missing, or improperly modified, hosted websites, email services, and DNS resolution can fail entirely. At FileRepair.net, we help administrators and hosting providers diagnose and recover damaged hosting configurations.

What WHM and cPanel Files Are

WebHost Manager (WHM) and cPanel are interconnected software platforms developed by cPanel, L.L.C. (now owned by WebPros). WHM operates at the server level, allowing administrators to create hosting packages, manage server resources, and provision individual cPanel accounts. cPanel operates at the domain or account level, allowing end-users to manage their websites, databases, and emails.

Rather than a single proprietary file format, a WHM environment relies on a structured hierarchy of plain-text configuration files, databases, and directories. These files dictate how the Apache web server, NGINX, Exim (mail), Dovecot, and BIND (DNS) operate. Key configuration structures include:

  • User Data Files: Files typically stored in /var/cpanel/users/ that define individual account parameters, including bandwidth limits, disk quotas, and associated domains.
  • DNS Zone Files: Text files formatted according to BIND standards, usually located in /var/named/, which map domain names to IP addresses.
  • Apache and Web Server Configurations: Virtual host includes and rewrite rules generated dynamically by WHM to direct web traffic.
  • Email and DNS Clustering Data: Configuration files that manage Exim routing, Dovecot mailboxes, and DNS clustering between multiple servers.

Because these files are mostly plain text or standard database formats (such as SQLite or MySQL databases used for roundcube webmail or Horde), they are highly susceptible to manual editing errors, disk failures, and abrupt server shutdowns.

Why WHM and cPanel Files Become Corrupt

Corruption in a cPanel or WHM environment typically occurs for several distinct reasons:

  • Abrupt Power Loss or Hard Reboots: If a server crashes or is forcefully rebooted while WHM is actively writing to account configuration files or updating a DNS zone, the file can be truncated or left with incomplete syntax.
  • Failed Updates or Downgrades: When cPanel updates its software tiers (e.g., moving from version 110 to 112), background scripts update configuration files. An interrupted update can leave configuration files in a hybrid, unreadable state.
  • Manual Editing Errors: Administrators often manually edit configuration files (such as httpd.conf includes or Exim filters) via the command line. A single syntax error, misplaced character, or incorrect file permission can cause the associated service to fail to restart.
  • Disk Quota Exhaustion: If a server's primary partition or an account reaches its disk quota limit, WHM may attempt to write to a configuration file and fail, resulting in a zero-byte file.
  • Underlying Filesystem Corruption: Hardware failures, degraded RAID arrays, or bad sectors on the server's storage drives can corrupt the underlying filesystem, destroying the plain-text configuration files that WHM relies upon.

What Data Can Be Recovered

When a WHM environment suffers file corruption, the recoverable data depends entirely on which specific files were damaged:

  • Account Configurations: If the /var/cpanel/users/ files are lost, the associations between domain names, IP addresses, and account owners can often be rebuilt by parsing backup archives or analyzing the remaining Apache and BIND configurations.
  • DNS Zones: Corrupted DNS zone files can usually be reconstructed from external DNS records, registrar data, or secondary DNS servers if clustering was enabled.
  • Email Configurations: While Exim and Dovecot configuration files can be restored to factory defaults, actual user email data (stored in standard Maildir formats) is usually recoverable even if the control panel interface cannot read it.
  • Website Data: Actual website files (HTML, PHP, images) and databases (MySQL/MariaDB) are typically stored independently of the control panel's core configuration files. Even if cPanel is entirely inaccessible, the underlying web data can usually be extracted directly from the server's filesystem.

How Recovery Works

Recovering a damaged WHM or cPanel environment requires a careful, methodical approach to avoid overwriting good data with bad configurations.

  1. Filesystem Imaging: Before any repair attempts are made, our team creates a bit-by-bit image or snapshot of the server's storage. This ensures that any recovery attempts can be undone if they further destabilize the environment.
  2. Service Isolation: We identify exactly which service is failing (e.g., web, mail, or DNS) by analyzing the server logs in /var/log/. This isolates the corruption to the specific configuration files governing that service.
  3. Syntax Repair and Validation: For plain-text configuration files, we manually repair broken syntax, remove truncated lines, and restore proper file ownership and permissions (typically root:root for system configurations).
  4. Rebuilding from Backups: If configuration files are entirely missing or zero-bytes in size, we extract and parse data from the server's local cPanel backups (often stored in /backup/), remote destination backups, or legacy configuration remnants.
  5. Reassociation and Testing: Once the files are repaired or rebuilt, we run validation scripts—often utilizing cPanel's built-in scripts such as /scripts/rebuildhttpdconf or /scripts/fixeverything—to ensure the control panel correctly recognizes the restored data. We then test web, mail, and DNS functionality before returning the server to production.

Frequently Asked Questions

What happens if my /var/cpanel/users/ directory is deleted?

If the user configuration files are deleted, cPanel will not know which domains belong to which accounts. However, the actual website files and databases usually remain intact. Recovery involves rebuilding these configuration files by extracting account data from your most recent WHM backup or by parsing the remaining Apache and DNS configurations.

Can I repair a corrupted cPanel configuration without losing my websites?

Yes. The control panel configuration files are largely separate from your actual web data (/home/username/public_html) and databases. Repairing or rebuilding WHM configuration files typically restores access to your control panel without affecting the underlying website files.

How do I fix a zero-byte configuration file?

A zero-byte file usually indicates that the server suffered an unexpected shutdown or ran out of disk space exactly while WHM was writing to the file. The file must be restored from a recent backup or rebuilt using cPanel's internal regeneration scripts. Simply deleting the zero-byte file and running the appropriate cPanel update or rebuild script often resolves the issue.

Is it safe to manually edit WHM configuration files?

WHM provides dynamic configuration templates. Manually editing auto-generated files (like the main httpd.conf) is highly discouraged, as WHM will overwrite them during the next update. Administrators should only make manual changes within the designated include files (such as pre_virtualhost_global.conf) to ensure changes persist safely.


If your server has suffered a configuration failure, a corrupted filesystem, or an inaccessible WHM control panel, do not attempt forced reboots or aggressive automated repairs, as these can overwrite recoverable data. Contact the team at FileRepair.net for a free evaluation, and let our experts safely diagnose and recover your critical hosting configuration files.

Send us your .whm file for a free evaluation

Our recovery engineers will tell you exactly what can be recovered — at no cost. There is no charge if we cannot recover your data.

Start a free evaluation