The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Point multiple domains to one cPanel account

Discussion in 'General Discussion' started by jbcams, Mar 13, 2014.

  1. jbcams

    jbcams Registered

    Joined:
    Sep 14, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    This was posted on Stackoverflow but I think I got drowned out pretty quickly so I'm hoping that someone here has experience with this:

    I am trying to figure out the best way to have multiple domains point to one cPanel account and I'm not entirely sure of the reasons for some of the technical aspects behind it so I'll set up my current scenario:

    Scenario

    I will call the main account 'MAIN' and the external domain one that points to it 'OUTSIDE' just for sake of clarity.

    I have a server with multiple IPs associated with it. There are a couple of cPanel accounts that currently use a single IP. If I create the account 'MAIN' using that already used IP, then the 'MAIN' domain works fine (obviously) but the 'OUTSIDE', which is also pointed to that IP with NO account associated just gives me the 'cgi-sys/defaultwebpage.cgi' (again, not very surprising).

    If I set up 'MAIN' account on its own IP and then point 'OUTSIDE' to that IP (still no account associated with 'OUTSIDE'), 'OUTSIDE' brings up my simple 'MAIN' index page (which echos nothing more than the URL that is accessing it).

    For the sake of comparison, I want to do something like the wildcard subdomain except with other domains

    Questions

    Is the only reason that my server renders 'MAIN' when accessed from 'OUTSIDE' because it is the only account on that IP?

    Is this a reliable way of making this work or am I oversimplifying and asking for trouble?

    I guess, to go along with the first question, should this even be working the way I have it set up?


    I really appreciate any guidance.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. jbcams

    jbcams Registered

    Joined:
    Sep 14, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi Michael, that's awesome. I guess that pretty much does what I need. I've been looking around for solutions to make this more automated and was wondering if there is anything in the cPanel API that would allow me (through php script) to automatically add a name into the parked domain list.

    In regards to the quick and dirty way I did it before, is there anything inherently wrong with it? I have tested from a couple of external domains and, as long as the main account domain is on its own IP, it seems to work ok.

    Thanks so much for your help.

    Regards,
    Jon
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Documentation on the parked domain API functionality is available here:

    Park Domain API

    There is nothing wrong with that method, however note that it will not work when using a shared IP address. The reason it works in the scenario you described is because a dedicated IP address will load the contents of the website assigned that IP.

    Thank you.
     
Loading...

Share This Page