Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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!
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice