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!

Wildcard Subdomains via API

Discussion in 'cPanel Developers' started by GeekPatrolMille, Oct 13, 2009.

  1. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    McKinney, Texas, USA
    The situation is a sales organization who wishes to have a server alias of *.domain.com so they can process any specialized site like agentname.domain.com on the fly.

    Can I write PHP script that allows for a cPanel user account to create and delete subdomains by using an API call?

    All that I have read so far indicate they would not be restricted to their own domain, is this correct?

    If I am mistaken and this is possible, can anyone give an example of how to do this please. Much gratitude in advance for your assistance...

    Thanks,-greg
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    McKinney, Texas, USA
    Found a simpler way to do this based on the documentation found here.

    cPanel - The Easy Apache Configuration System - Adding Custom Directives to httpd.conf

    I created the folder structure as follows:
    /usr/local/apache/conf/userdata/std/2/domain/domainname.net/

    in this folder I placed a file called "wildcard_subdomains.conf"

    In the httpd.conf file I uncommented the last line of the VirtualHost directive to Include *.conf from the folder above.

    restarted apache and it all worked fine.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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