SSH Mounted a new Drive, now home directory for websites changed

rmittler

Registered
Jun 3, 2014
3
0
1
cPanel Access Level
Root Administrator
A week or so ago I had a new hard drive added onto my dedicated server for additional storage because I am placing a video site up on the server and will be storing a lot of videos. So I wanted to mount this drive onto a directory within the the public_html directory of the new website. This server hosts multiple sites so I created a new directory within the new sites directory called 'Videos' and then mounted the new drive onto this directory. The videos are being uploaded to the new drive with no problem.

I used SSH to do the above commands and I use WHM/CPANEL to create the new site.

Today I needed to add a new site to the server for a customer so I logged into the CPANEL but when I created the new site, the home directory of this site got created in the videos folder as well. When I went to the site I am getting an error: Template Error: The template file must be given (or the template could not be opened).. When I checked the email I received after creating the site I noticed that the HomeRoot was set to /home/videoho/public_html/videos - which is where I mounted the drive for the additional storage. When I SSH into the server and check my home directory, I am not seeing the new site directory here. However, when I

I am not exactly sure how to resolve this issue...

Any assistance is really really appreciated. Thank you!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

It looks like the script was installed in the wrong directory. How did you upload this script? Was it manually or through the "Site Software" option in cPanel? Check to ensure you uploaded the script to the correct directory and configured it to match the path it's installed in. A screenshot of the issue may also be helpful.

Thank you.
 

rmittler

Registered
Jun 3, 2014
3
0
1
cPanel Access Level
Root Administrator
Which script are you referring to? I did not use a script to mount the drive, I was logged into the server using SSH and mounted the drive manually. Since doing that, when I log into the WHM to create a new site, it creates it in the directory I mounted the new drive in.

For example, the standard directory is /home and this is where all my sites are located. I can see the directories in here when I SSH to the server. I mounted the drive to /home/videoho/public_html/Videos - I mounted the new drive here because I will be storing a lot of videos on this site and I needed additional storage space.

Unfortunately since doing so, when I log back into the WHM to create a new site, it is being created in: /home/videoho/public_html/Videos - I know this for two reasons, for one the confirmation email I receive shows the directory where the site was created and for two, you are shown a confirmation after creating the site in WHM. So when I saw this, I knew something was wrong and that it was related the mount command I performed. But... always a but... I am not sure how to un-do this without damaging anything. When I log into the WHM and check the server config, it still shows that the default location is /home so at this point I am kinda stuck and not sure what to do.

All the other sites are working just fine, I have 40 other sites on the server. The new site I created doesnt show up anywhere on the server, not even under the directory it says it created it in. So when I browse to /home/videoho/public_html/Videos either on SSH or through the file explorer of the videoho website, I do not see any new public_html directories... Oddly though, if you go to the site, it looks like the something is being hosted because it shows the error: Template Error: The template file must be given (or the template could not be opened)

Thank you again!
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Browse to "WHM Home » Server Configuration » Basic cPanel & WHM Setup" and update the following option:

"Additional home directories matching the following value will also be used for new home directory creations. (Leaving this value blank disables the feature.) This option only takes one value."

Change it to a blank value, and see if the issue persists when creating new accounts.

Thank you.
 

Michael-Inet

Well-Known Member
Feb 20, 2014
117
15
68
Nashville, TN, USA
cPanel Access Level
Root Administrator
This post explains how to do this:

SSH Mounted a new Drive, now home directory for websites changed

But it’s too old to add comments to, and it needs more info so Google will find the post, as it took about six changes of search phrases to get there.


Browse to "WHM Home » Server Configuration » Basic cPanel & WHM Setup" and update the following option:

"Additional home directories matching the following value will also be used for new home directory creations. (Leaving this value blank disables the feature.) This option only takes one value."

Change it to a blank value, and see if the issue persists when creating new accounts.

Thank you.
I’d rather the below just be added to that post, but, eh, hopefully this will save someone else from spending an hour digging though Google like I did.

# # #

Yeah, freaking bizarre…

I’ve had other WHM systems built with the exact same drive mounting:

SSD: /
SpinDisk: /home/common

and never had this problem. This new server defaults to creating accounts on:

/home/common/[accountname]

even though “Enter the location where you wish for new users’ home directories to be created.” is set to /home.

And yes, removing “home” from “Additional home directories matching the following value will also be used for new home directory creations.” fixes the problem and puts accounts back on /home.

I’ll leave the question as to why it has any value by default for those more inquisitive.

Searches that should have gotten there but didn’t:

How do you change the default package home directory in WHM?
Where do you set the cPanel new account home directory?
Where do you set the cPanel HomeRoot?

And the winner was:
"HomeRoot" whm