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.

Using cPanel API in Cluster

Discussion in 'cPanel Developers' started by dsm, Jul 28, 2014.

  1. dsm

    dsm Member

    Joined:
    Jul 28, 2014
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm doing the following configuration in my servers:

    VPS 1 - DNS Only (ns1)
    VPS 2 - DNS Only (ns2)
    Dedicated 1 - Web Server (Normal users)
    Dedicated 2 - Web Server (Premium users)

    According to the documentation, to create a new user just use the following method:
    Code:
    https://example.com:2087/xml-api/createacct?username=myuser&plan=basic &ip=n&cpmod=x3&password=h@rd2gu3ss!p@ss&contact email=username @domain.tld&domain=domain.tld&useregns=0&reseller=0
    My question is: How can I direct each user to his specific server?

    Thank you all!
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Run the API against the server the customer is supposed to be on. If the two web servers are clustered to both nameservers, the web server the account is created on will sync the DNS config based on what that server says the IP should be. So the nameservers will then direct requests for that domain to that IP address, which resides on the proper server.
     
  3. dsm

    dsm Member

    Joined:
    Jul 28, 2014
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Both servers are clustered for both name servers. If I call the API using the security token, like this:
    /https://example.com:2087/SECURITYTOKEN/json-api/functionname

    Will direct you to the right server, right?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It's going to create the account on whichever hosting server "example.com" points to. Note that the DNS zone will automatically synchronize to the DNS-Only servers upon it's creation if you have configured the cluster.

    Thank you.
     
  5. dsm

    dsm Member

    Joined:
    Jul 28, 2014
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I will configure the cluster. Each server generates a security token, right?
    Even using the security token, the DNS-Only automatically decide which server will host the domain?
    I can not mix the domains from normal users with the premium users on the same server

    Thank you!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I am not sure I understand your question. Accounts are not hosted on DNS-Only servers, only the zones are hosted. Generally speaking, you are not going to have to perform any actions on the DNS-Only servers after you configure the cluster. As far as security tokens, I believe you might be looking for information explained in this document:

    Secure Remote Logins

    Thank you.
     
  7. dsm

    dsm Member

    Joined:
    Jul 28, 2014
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm sorry for not being clear in my questions. I need to use a translator and often the texts are not understandable. But I understood what I needed. Any further doubt try the forum again.

    Thanks for the replies and for your patience :)
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page