Introduction
When setting up a server you may want to arrange the groups of features within cPanel in a particular order.
Maybe you value email actions over databases and want to have the email features at the top of cPanel when a user logs in to cPanel.
That order is saved in the following location of each user's home directory.
- /home/USER/.cpanel/nvdata/xmaingroupsorder
- /home/USER/.cpanel/nvdata/xmainrollstatus
Procedure
To set the custom order you will need to log in to an existing cPanel account. Then arrange the feature group layout however you would like. To do this you can click and drag the dark blue bar above the group of features you want to move. This will create the xmaingroupsorder and xmainrollstatus files in the user's home directory. Now you have a template you can use for other accounts.
Here is an example of each file:
# cat xmaingroupsorder
domains|files|databases|email|attracta_seo|metrics|security|software|advanced|preferences|applications
# cat xmainrollstatus
|files=0
How can I set the order for new accounts?
To automatically add custom files to new accounts you will use the skeleton directory. The contents of the skeleton directory will be copied to any new user's home directory during creation.
For accounts owned by the root user, the skeleton directory is located here:
/root/cpanel3-skel
For a reseller, it would be found here: (update reseller with the actual reseller username)
/home/reseller/cpanel3-skel
For more details on the skeleton directory please see our documentation.
https://docs.cpanel.net/whm/account-functions/skeleton-directory/
Now we need to add the .cpanel/nvdata directories to the skeleton directory. You can use this command to create the directory structure:
mkdir -pv /root/cpanel3-skel/.cpanel/nvdata/
Now you are ready to place the xmainrollstatus and xmaingroupsorder files in the skeleton directory.
The following commands will copy the files from an existing user to the skeleton directory.
cp /home/username/.cpanel/nvdata/xmainrollstatus /root/cpanel3-skel/.cpanel/nvdata/xmainrollstatus
cp /home/username/.cpanel/nvdata/xmaingroupsorder /root/cpanel3-skel/.cpanel/nvdata/xmaingroupsorder
How can I set the order for existing accounts?
You could copy the xmaingroupsorder and xmainrollstatus files to each user's home directory, but that would override any existing order they have already set up on their own.
A better way to change the feature order for existing accounts is to use the API call. Please be sure to update "username" with the actual cPanel username.
To see the current configuration the following API call would be used:
uapi --user=username NVData get names='xmaingroupsorder|xmainrollstatus'
To change the configuration you would use the following API call:
uapi --user=username NVData set names='xmaingroupsorder|xmainrollstatus' xmaingroupsorder='databases|files|domains|email|metrics|security|software|advanced|preferences' xmainrollstatus=''
The following documentation will contain additional information for the API calls.
https://documentation.cpanel.net/display/DD/UAPI+Functions+-+NVData::get
https://documentation.cpanel.net/display/DD/UAPI+Functions+-+NVData::set