How to rebuild user data files for cPanel

How to Rebuild User Data Files for cPanel

The userdata directory is one of the most important directories in cPanel. Located at /var/cpanel/userdata/, it stores the configuration data for each cPanel account, including virtual host configurations, addon domains, subdomains, and SSL settings.

When Do You Need to Rebuild Userdata?

  • Websites returning 500 errors or not loading after migration
  • Apache configuration is corrupted
  • Domain not resolving despite being added in cPanel
  • SSL certificates not applying to domains
  • After restoring accounts from backup

How to Rebuild Userdata

Log in to your server via SSH as root and run:

/scripts/updateuserdomains
/scripts/rebuildhttpdconf
systemctl restart httpd

Rebuild Userdata for a Specific User

/scripts/updateuserdomains --user=username
/scripts/rebuildhttpdconf
systemctl restart httpd

Full Rebuild Sequence

For a complete repair of all user configurations:

# Step 1: Update user domain mappings
/scripts/updateuserdomains

# Step 2: Rebuild mail configuration
/scripts/rebuildemailconfig

# Step 3: Rebuild Apache/Nginx configuration
/scripts/rebuildhttpdconf

# Step 4: Rebuild PHP-FPM pools
/scripts/php_fpm_config --rebuild

# Step 5: Restart services
systemctl restart httpd
systemctl restart cpanel-dovecot-solr

Verify the Rebuild

# Check Apache configuration syntax
httpd -t

# View the userdata for a specific account
cat /var/cpanel/userdata/username/main

Common Issues After Rebuild

  • Apache fails to start: Check syntax with httpd -t and fix any reported errors.
  • Domains still not working: Verify DNS records point to the correct server IP.
  • Permission errors: Ensure userdata files are owned by root: chown -R root:root /var/cpanel/userdata/
  • cpanel, userdata, rebuild, apache, troubleshooting
  • 0 Корисниците го најдоа ова како корисно
Дали Ви помогна овој одговор?

Понудени резултати

How to Backup and Restore cPanel Accounts via SSH

How to Backup and Restore cPanel Accounts via SSH Backing up and restoring cPanel accounts via...

How to GET Unlimited hosting with Free Domain Name

How to Get Unlimited Hosting with a Free Domain Name At SubwayHost, we offer unlimited hosting...

How to fix cPanel 500 internal server error

How to Fix cPanel 500 Internal Server Error A 500 Internal Server Error in cPanel is one of the...

cPanel does not support NetworkManager enabled

Fix: cPanel Does Not Support NetworkManager Enabled If you encounter the following error while...

How to install Softaculous on cPanel/WHM

How to Install Softaculous on cPanel/WHM Softaculous is the leading auto-installer for web...