Amahdy

Member
Mar 7, 2008
6
0
51
Maady
Hey,

I have a strange problem and I'm not sure if it's a bug or what's going wrong exactly:

Here is a short story about what happened:

- I have an old account "account1"
- I have also installed a new hard-drive
- In "account1" I have a special folder called "folder1", its location is: "/home/account1/www/folder1"
- because "folder1" is very important for me and it contains too much data, I placed its location to be a mount point for the new hard-drive, and for security I placed a ".htaccess" file inside it to prevent any access to this folder throw web
- Recently I have created a new account "account2" using WHM
- * The new account was placed inside my new hard-drive instead of the home folder, which means the "account2" location is "/home/account1/www/folder1/account2" instead of "/home/account2"
- When I try to open a web-access from the "account2" I receive an authentication required and the effect of ".htaccess" appear
- When I remove the .htaccess" file I can open the account
- I cannot keep it without the ".htaccess" because like I said before "folder1" is very critical
- I also don't prefer to keep the new account inside this location so I had to move it
- I opened a SSH session and placed this command:
"usermod -d /home/account2 -m account2"
- The account was moved greatly and it's shown correctly under cpanel and some locations in WHP, but for some reason apache still think its location is "/home/account1/www/folder1/account2" and try to load files from "/home/account1/www/folder1/account2/public_html/*"
- I tested and this is true, apache still think that the account location is the old one although I already moved it
- I also tried to restart apache but no change

I need to know what's exactly wrong here to fix it and why "*" happens by anyway and how to prevent it from hapening for new accounts

Thanks!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
Hey,

I have a strange problem and I'm not sure if it's a bug or what's going wrong exactly:

Here is a short story about what happened:

- I have an old account "account1"
- I have also installed a new hard-drive
- In "account1" I have a special folder called "folder1", its location is: "/home/account1/www/folder1"
- because "folder1" is very important for me and it contains too much data, I placed its location to be a mount point for the new hard-drive, and for security I placed a ".htaccess" file inside it to prevent any access to this folder throw web
- Recently I have created a new account "account2" using WHM
- * The new account was placed inside my new hard-drive instead of the home folder, which means the "account2" location is "/home/account1/www/folder1/account2" instead of "/home/account2"
- When I try to open a web-access from the "account2" I receive an authentication required and the effect of ".htaccess" appear
- When I remove the .htaccess" file I can open the account
- I cannot keep it without the ".htaccess" because like I said before "folder1" is very critical
- I also don't prefer to keep the new account inside this location so I had to move it
- I opened a SSH session and placed this command:
"usermod -d /home/account2 -m account2"
- The account was moved greatly and it's shown correctly under cpanel and some locations in WHP, but for some reason apache still think its location is "/home/account1/www/folder1/account2" and try to load files from "/home/account1/www/folder1/account2/public_html/*"
- I tested and this is true, apache still think that the account location is the old one although I already moved it
- I also tried to restart apache but no change

I need to know what's exactly wrong here to fix it and why "*" happens by anyway and how to prevent it from hapening for new accounts

Thanks!
It sounds like cPanel/WHM thinks that's a second home directory. You mentioned that folder1 is a mount point. However, that would mean that the path contains the phrase 'home'. By default, since the home directory prefix is 'home' that means any mountpoint with 'home' in it will be treated as a place to store accounts. The mountpoint with the most available disk space is used first.

To disable this behavior, I recommend changing your Home Directory Prefix setting in WHM -> Server Configuration -> Basic cPanel/WHM Setup to a blank value. Be sure to click "save" at the bottom of that page.
 

Amahdy

Member
Mar 7, 2008
6
0
51
Maady
It sounds like cPanel/WHM thinks that's a second home directory
Ok this is answers to (Why "*" Happens)

I recommend changing your Home Directory Prefix setting in WHM -> Server Configuration -> Basic cPanel/WHM Setup to a blank value.
When I do this, I'm unable to create ANY new accounts anymore, when I try to create an account an error message appear telling me that the "Home Directory" was not specified and hangs up.
So I don't think it's a solution for "How to prevent it from happening for new accounts
"

I'm also wondering "What's exactly wrong here to fix it"???
I mean where is the configuration file where I can adjust the correct new location of my new account "account2"?

You can go to WHM -> Account Functions -> Rearrange Accounts to move Account2 to /home.
No this does not work either, It is only showing my mount-point for accounts in my "/home" but for account in other location have no place to move to and "/home" is not listed for them.

contact our technical analysts for assistance: http://tickets.cPanel.net/submit
When I opened this link and entered my IP it's showing me my host "theplanet" but I already opened a ticket at theplanet and they requested money for fixing this for me, I don't think that I'm going to pay money for this little misconfiguration, I'm sure it's just one line in some configuration file where the home dir for account2 is written as "/home/account1/www/folder1/account2" instead of "/home/account2". I just need help to find this configuration file and fix it and I'm guessing that it may be some bug in WHM and wanted to report it.

Thanks!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
When I do this, I'm unable to create ANY new accounts anymore, when I try to create an account an error message appear telling me that the "Home Directory" was not specified and hangs up.
What do you have for the Default Home Directory setting in WHM -> Server Configuration -> Basic cPanel/WHM Config?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
A blank value make me unable to create a new account.
Correct, making "Default Home Directory" blank would likely prevent the creation of new accounts.

However setting "Home Directory Prefix" to a blank value should not have this effect.

Please let our technical analysts take a look at your server to determine what is causing these issues. They can probably handle moving "account2" as well. You can contact our technical analysts at: http://tickets.cPanel.net/submit
 

Amahdy

Member
Mar 7, 2008
6
0
51
Maady
Yes that's true, thanks!

I belive I was able to move the account correctly I just wanted to know what's the wrong with apache or WHM or whatever ... one of them still think that the account was not moved and try to open it from the old location.
I hope if I was able to just change whatever configuration to tell it that my new home location has changed.

Anyway Thank you for your support.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Dude! Too complicated! :D

One word for you .... "Backup" ;)

I wouldn't worry about all these odd non-standard configurations and
just set things up normally as they would be under normal circumstances
and regarding your "important files", I would make sure you have good
backups elsewhere both online and offline and then you are safe since
you will have those files no matter what happens.

If you setup your regular backup process to backup your data from your
first drive to your second drive, that will further mitigate loosing the data.
 

Amahdy

Member
Mar 7, 2008
6
0
51
Maady
Of course I'm worried about loosing the data but also I'm worried about accessing and the security of the data, I set up a rule in the .htaccess file to not allow anybody to read this directory, and to make things go cleanly I wanted to not have anything stored there, no new accounts nor anything ....

That was a WHM thingy to know here that it attempt to store new accounts in the emptiest mount point which was not what I needed ...