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

    Oct 5, 2006
    Likes Received:
    Trophy Points:

    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 =
    New account = newuser, domain =

    I need to (1) create, (2) park on top of and (3) Add an A record for "newuser" to DNS, making it point to'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!

Share This Page