How to Rebuild user Data Files from a Valid httpd.conf File

August 22, 2020 / How-to Guide

In some situations your server’s user data files (/var/cpanel/userdata/ directory comprises for each account) may get corrupted or can be entirely missing.

Steps to rebuild user data files with a valid httpd.conf file: 

  1. The corrupt user data directory must be moved to a new location.
    You can do this by using the mv command to move the directory and its contents to a new location.
    mv /var/cpanel/userdata /var/cpanel/userdata.orig
  2. A new user data directory must be created.
    To create a new user data directory use the mkdir command.
    mkdir /var/cpanel/userdata
  3. To rebuild user data files run userdata_updatethe  script.
    The /usr/local/cpanel/bin/userdata_update script restores userdata files for all of the accounts that are present on your server.
    /usr/local/cpanel/bin/userdata_update –reset
  4. To validate the user data permissions settings run the script fix_userdata_perms.
    The /usr/local/cpanel/bin/fix_userdata_perms script makes certain that all of your server’s userdata files and directories are assigned the correct permissions settings.
    /usr/local/cpanel/bin/fix_userdata_perms

  5. To update the system’s cache run script updateuserdatacache.
    The /scripts/updateuserdatacache script makes sure that the system appropriately caches all user data files.
    /scripts/updateuserdatacache

  6. Restore Apache
    To use the rebuilt user data files, you must rebuild Apache.
    /scripts/rebuildhttpdconf


  7. Apache Restart is required
    Restart Apache on your server after you rebuild it.
    /scripts/restartsrv_httpd

This way you can rebuild user data files from a valid httpd.conf file.

Spread the love