DNS Settings, mapping and all that jazz

glauco

Member
Aug 26, 2011
16
1
53
I am a newbie who just got himself a VPS and is feeling rather confused, perhaps some kind souls with more experience can point me in the right direction.
My VPS runs CentOS with WHM 11.30. I have a client whose website I need to redesign and then transfer over to my VPS from a different hosting provider. I'll call his domain hisdomain.com.
I created an account through WHM and called it hisdomain.com, of course the Name Servers don't currently point to it. So when I went to install Magento through CPanel and Softaculous on his account, it installed fine but I had no way of accessing the installation and working on it, because of the domain not resolving. Softaculous wanted me to administer Magento at URL hisdomain.com/admin but of course that didn't work.
There was probably a way (using my VPS's IP address) but I couldn't find it so I gave up and installed Magento in a subdirectory of my own domain. So Magento is now in mydomain.com/hisdomain.
My question now is: when it comes to changing the Name Servers at his registrar to point to my development site, will I need to migrate or copy the whole Magento installation to the root/home/hisdomain folder created by WHM - which I would rather not do - or is there a way to "map" the account to the subdirectory I've been working on, so that as soon as the domain resolves to my VPS, browsers pointing to hisdomain.com will see the Magento installation in mydomain.com/hisdomain?
I don't understand much about DNS settings and MX entries so I don't know if this can be done.
Basically, where in the VPS is the record that points hisdomain.com to the folder root/home/hisdomain and how do I edit that to point to mydomain.com/hisdomain instead?
I hope I am making sense and not sounding like a total idiot, apologies if I am.
Thanks!!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
You could change his document root, but that's a nightmare because the files won't be visible in his File Manager or for FTP for him either. Also, ownership for the files and folders will be an issue (they will need to be owned by your user).

The two better options would be:

1. Add his domain as an addon domain on your account and only give him FTP access to it. He'll then have FTP access to see the files and folders without access to your files and folders

2. Move everything to his account, including the database

Of note, if you haven't done too much yet, it might be good to simply go back to putting everything onto his domain, then pointing your hosts file to your machine for resolving his domain. That way you could use his domain before it has been pointed. Here's a discussion on the hosts file on various systems:

Hosts (file) - Wikipedia, the free encyclopedia