CPanel and WHM on Single Site / Single IP - New Server

Chris-777

Member
Apr 8, 2011
21
0
51
Hi folks,

I'm a long time Plesk user and new to WHM and CPanel, so my apologies if this is a relatively amateur question.

I have a new dedicated server with 5 IPs. I have a couple of domains that I'm moving to it, with DNS transfers in process. For the sake of discussion, maindomain.com and otherdomain.com.

When I setup WHM, it asked me for the domain name, so I used maindomain.com, with the first IP in my range (.114). I then created an Account for maindomain.com, so that I could use cPanel on it. This account is also called maindomain.com, and (I believe) cPanel took care of mail.maindomain.com and www.maindomain.com.

I then made a second account for otherdomain.com, and gave it an ip of .115. This seemed to work just fine.

If I hit my ip 1.2.3.115/~otherdomain, I get the correct index that I've put up there. However if I hit 1.2.3.114/~maindomain, I get a 404.

In my WHM networking settings, I have WHM configured to be s1.maindomain.com. I also do my own DNS, and would be using ns1.maindomain.com and ns2.maindomain.com.

Did I do this incorrectly?

Should I take a separate IP (.116) for the maindomain.com _Account_, and use the .114 only for WHM? I'm confused that if I point my dns for maindomain.com at .114 with WHM and the actual WWW domain located there, if WHM will respond to s1.tld and the /home/accountname folder will be the web root for www.maindomain.com.

In a nutshell, I'm not sure the proper way of having WHM and an account under it share the same IP. Both have DNS settings as well, and I don't know if I need to add my nameservers in WHM, or if I add them in cPanel.

Any insight would really be appreciated.

Thanks!
 

ARPLink

Member
Mar 7, 2011
7
0
51
Hi,

Having account on a main IP isn't a problem, but the usual rule is to avoid hosting accounts on the main server's IP address unless you don't have a choice in the matter. As for your problem, did you have a look at mod_userdir configuration? As for the nameservers, If you set them up in /etc/nameserverips, aded A records for them, the hostname, and you already have DNS zones for account 1 & 2 mentioned in your post, you should be good to go.
 

Chris-777

Member
Apr 8, 2011
21
0
51
Thanks for the reply! :)

I'm still a bit confused, so with my apologies -

If I assign my WHM as s1.maindomain.com, as IP .114
And in WHM, I create an Account for maindomain.com, with cPanel, at IP .115

I should have my registrar (GoDaddy) point to .115 for DNS for maindomain.com, and add an A record for s1.maindomain.com that points to .114?

It just seems as though WHM, being my server, should be the TLD as well, but if I understand you correctly, WHM doesn't care where it runs, as long as the IP of whatever my DNS points to matches it. So if I make .115 (the Account/Client IP) the DNS pointer for maindomain.com, and in the client make an A record that points to WHM (.114) for s1.maindomain.com, I should be good to go?

Basically, a client running under WHM can do DNS for the WHM server itself?

I feel as though I'm playing who's on first, but I hope that's clear. :) (I'm not using my actual domain name because I don't want to appear as though I'm throwing my URL around).
 

ARPLink

Member
Mar 7, 2011
7
0
51
Ok :), I'll try to be as clear as possible.

WHM is practically the grafic version of SSH root. In this case, it will run on the hostname's IP. I'm getting the feeling that you're mistaking cPanel with WHM a little bit. When you go to your registar, just change the nameservers with the one created on the server and make sure you add the IP's as well if that domain will be your main one.

The only users who have access to WHM are resellers and root. You don't need to add any A record for WHM, it takes care of itself in that department :).

So, quick example:

1.You buy a server.
2.The datacenter gives the login details and the hostname IP: 192.168.0.1. You also have 3 other IP available: 192.168.0.2-4
3.You install cPanel, log in to WHM, set the hostname to server.site.com in the initial setup
4.Set up 2 nameservers: ns1.site.com and ns2.site.com
5.Log in with SSH root and edit /etc/nameserverips and add:
192.168.0.1=0
192.168.0.2=ns1.site.com
192.168.0.3=ns2.site.com

192.168.0.4=0
6.Save file
7.Go to WHM, add A records for the nameservers(you can do this automatically from Basic cPanel & WHM Setup section)
8.Make sure you have selected BIND nameserver
9.Make sure you added an A record for the hostname(you can do this automatically from Basic Add an A Entry for your Hostname section)
10.Go to your registar and modify the main domain's, site.com, nameservers. Make sure to add the coresponding nameserver ip addresses mentioned above(the bold ones)
11.Wait for the changes to propagate
12.Modify your main shared IP so that every account you create will point to that IP. You can do this from Basic cPanel & WHM Setup section.

Note: please replace the IPs and nameservers mentioned in the example with your real IPs and nameservers
Hope this helps :).