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.

Automate subdomain creation for new accounts

Discussion in 'cPanel Developers' started by Xavior82, Oct 15, 2009.

  1. Xavior82

    Xavior82 Active Member
    PartnerNOC

    Joined:
    Oct 5, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Montreal
    Hi,

    I am trying to get a server to comply with PCI-compliance scan and have thus turned off the UserDir directive allowing users to access their files over HTTP via IP/~user address. However, I would like to allow them to still have "preview" functionality on their sites using a subdomain instead.

    I am trying to figure out the best way of automating this process. As it stands, I need to:

    1. Create a new account
    2. Park a subdomain of my master domain on top of this account
    3. Edit the DNS zone of my master domain, adding an A record for the subdomain to point to new account's IP address

    For example, master domain = shorturl.com
    New account = newuser, domain = newuserdomain.com

    I need to (1) create newuserdomain.com, (2) park newuser.shorturl.com on top of newuserdomain.com and (3) Add an A record for "newuser" to shorturl.com DNS, making it point to newuserdomain.com's IP.

    I am guessing a solution for this has already been implemented many times over (as I've already seen it in action), but am wondering what the best way of tackling this problem would be.

    Thanks in advance for your help!
     
Loading...

Share This Page