BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to Rebuild ‘Userdata’ from httpd.conf File?

Posted by Allura on 19 07 2019.

Introduction
A server’s userdata  files are those that the /var/cpanel/userdata/  directory contains for each account. It may happen that these files may become unscrupulous, or lose its existence. In such a situation, user can rebuild these files either by following the Rebuild userdata files with a valid httpd.conf file (if a valid httpd.conf file exists) or by following the Rebuild userdata files from a recent backup (if a valid httpd.conf file does not exist). In this document, we will go through the steps to rebuild userdata files from a valid httpd.conf file.Rebuild Userdata Files From A Valid httpd.conf FileStep 1: Move The Corrupt Userdata Directory To A New Location
User can use the following mv command to move the corrupt userdata directory and its contents to a new location, if the userdata directory exists on the server:mv /var/cpanel/userdata /var/cpanel/userdadirectoStep 2: Create A New Userdata Directory
User can use the following mkdir command in…

Introduction

A server’s userdata  files are those that the /var/cpanel/userdata/  directory contains for each account. It may happen that these files may become unscrupulous, or lose its existence. In such a situation, user can rebuild these files either by following the Rebuild userdata files with a valid httpd.conf file (if a valid httpd.conf file exists) or by following the Rebuild userdata files from a recent backup (if a valid httpd.conf file does not exist). In this document, we will go through the steps to rebuild userdata files from a valid httpd.conf file.

Rebuild Userdata Files From A Valid httpd.conf File

Step 1: Move The Corrupt Userdata Directory To A New Location

User can use the following mv command to move the corrupt userdata directory and its contents to a new location, if the userdata directory exists on the server:

mv /var/cpanel/userdata /var/cpanel/userdadirecto

Step 2: Create A New Userdata Directory

User can use the following mkdir command in order to create a new userdata directory:

mkdir /var/cpanel/userdata

Step 3: Run The userdata_update Script To Rebuild Userdata Files For All Of Your Accounts

The /usr/local/cpanel/bin/userdata_update  script helps in rebuilding the  userdata files for all of the accounts existing on the server.

The following command needs to be run for this purpose:

/usr/local/cpanel/bin/userdata_update –reset

It is to be noted that user should run the /usr/local/cpanel/bin/userdata_update  script adding the –unpark-addons flag in order to fix problems in which an addon domain is listed as a parked domain (alias) by the system. This flag will reset all of the server’s userdata files.

Step 4: Run The fix_userdata_perms Script To Validate The Userdata Permissions Settings

The /usr/local/cpanel/bin/fix_userdata_perms  script helps a user in ensuring that the server’s userdata  files and directories are using the correct permissions settings. In order to check this, user can run the following command:

/usr/local/cpanel/bin/fix_userdata_perms

Step 5: Run The updateuserdatacache Script To Update The System’s Cache

The /scripts/updateuserdatacache script helps in ensuring that the system properly caches all userdata files.

The following command needs to be run for this purpose:

/scripts/updateuserdatacache

Step 6: Rebuild Apache

User can run this following command in order to rebuild Apache to use the rebuilt userdata files.

/scripts/rebuildhttpdconf

Step 7: Restart Apache

User can run this following command in order to restart the Apache, after rebuilding it:

/scripts/restartsrv_httpd

Conclusion

All information on how to rebuild userdata from httpd.conf file (if a valid httpd.conf file exists) is outlined in this review.