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.

Multiple Servers, One cPanel Login....

Discussion in 'cPanel Developers' started by sirbrent, Dec 17, 2008.

  1. sirbrent

    sirbrent Well-Known Member

    Joined:
    Sep 30, 2008
    Messages:
    98
    Likes Received:
    1
    Trophy Points:
    8
    Hello,

    If I have two servers with hostnames of server1.mydomain.com and server2.mydomain.com... both are setup in a cluster in WHM to sync DNS zones.

    Is it possible to have cpanel login for accounts at either server from a central location? meaning.... if someone were to goto: http://cpanel.mydomain.com they could login to thier account (and be sent to the correct server)?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Assuming you don't want them going to cpanel.TheirDomain.com or TheirDomain.com/cpanel, an old trick used to be to prompt the user for their domain as well and redirect them to http://example.com/cpanel/...

    A better solution would be to use the listaccts function of the XML-API to determine which servers host which users, store that internally on your script and redirect users based on their username (which you match with which server to log them into) to the appropriate server.
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Using the XML-API for multiple servers is just like using it for a single server, just use the different credentials when connecting to a different server - that's all :).

    Documentation for the listaccts function can be found at:

    http://cpanel.net/plugins/xmlapi/listaccts.html

    You can find many code samples for the XML-API on these forums, especially in the Developers section.
     
  4. sirbrent

    sirbrent Well-Known Member

    Joined:
    Sep 30, 2008
    Messages:
    98
    Likes Received:
    1
    Trophy Points:
    8
    Thanks for the swift reply! Do you happen to know of any examples of the functionality (using XML-API for multi-server login)?
     
Loading...

Share This Page