Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    1

    Default Script to create subdomains/parked domains

    Hello,

    I am currently writing a "web service" like collection of scripts to act as a wrapper around cpanel to enable cpanel like functionality within the content manager that we sell.

    Basically we are trying to include the most used functionality into these scripts. These scripts are served by the cpanel webserver, so they have the same permissions as the user frontend.

    My question is this, what application does the cpanel user frontend use to create subdomains and parked domains?

    My best guess is the /usr/local/cpanel/bin/domainadmin application, but I can't seem to find its usage anywhere.

    I was able to very easily replicate the add/delete/edit email account type functions thanks to the /usr/local/cpanel/cpanel-email application. I am hoping there is a similar one for domains!

    I really don't want to try and replicate this process... setting up apache virt hosts, email accounts, dns records, ftp accounts etc... ergh.

    Any help welcome,

    Thanks,

    Michael

  2. #2
    Member
    Join Date
    Mar 2007
    Posts
    27

    Default

    where did you find the usage for /usr/local/cpanel/cpanel-email ?

  3. #3
    BANNED
    Join Date
    Jun 2007
    Posts
    31

    Default

    Have you tried getting a billing system? Try http://www.modernbill.com
    If you can configure it properly regarding their FAQ then you can get automated accounts and things like that.

  4. #4
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by garlic View Post
    Hello,

    I am currently writing a "web service" like collection of scripts to act as a wrapper around cpanel to enable cpanel like functionality within the content manager that we sell.

    Basically we are trying to include the most used functionality into these scripts. These scripts are served by the cpanel webserver, so they have the same permissions as the user frontend.

    My question is this, what application does the cpanel user frontend use to create subdomains and parked domains?

    My best guess is the /usr/local/cpanel/bin/domainadmin application, but I can't seem to find its usage anywhere.

    I was able to very easily replicate the add/delete/edit email account type functions thanks to the /usr/local/cpanel/cpanel-email application. I am hoping there is a similar one for domains!

    I really don't want to try and replicate this process... setting up apache virt hosts, email accounts, dns records, ftp accounts etc... ergh.

    Any help welcome,

    Thanks,

    Michael

    echo "[UID] ADD [SUB] [DOMAIN] [TURN OFF CAN NAME] [DIR]" | /usr/local/cpanel/bin/domainadmin
    [UID] = unix uid of user to add domain to
    [SUB] = subdomain portion of the domain ==>bob<===.cpanel.net
    [DOMAIN] non sub portion bob.==>cpanel.net<==
    [TURN OFF CAN NAME] = 0 for subdomains, 1 for addon domains
    [DIR] = /home/USER/public_html/bob


    echo "[UID] ADD [DOMAIN] [TOPDOMAIN]" | /usr/local/cpanel/bin/parkadmin
    [UID] = unix uid of user to add domain to
    [DOMAIN] = parked domain
    [TOPDOMAIN] = domain to park on

  5. #5
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    You could also use the AdminBin Lib


    use Cpanel::AdminBin ();

    my $res = Cpanel::AdminBin::adminrun( 'park', 'ADD', $domain, $topdomain );
    if ( !$Cpanel::CPERROR{'park'} ) {
    return ( 1, $res );
    }
    else {
    return ( 0, $Cpanel::CPERROR{'park'} );
    }

  6. #6
    Member
    Join Date
    Mar 2007
    Posts
    27

    Default

    I dont want a billing system. I just want to be able to script some processes. One of the processes I would like to script is creation/deletion of email forwards. I would also like to script email creation .... however i can find examples of email creation. I just cant seem to find usage for the cpanel-email script.

  7. #7
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by cmdln View Post
    I dont want a billing system. I just want to be able to script some processes. One of the processes I would like to script is creation/deletion of email forwards. I would also like to script email creation .... however i can find examples of email creation. I just cant seem to find usage for the cpanel-email script.
    cpanel-email: usage
    addpop <popuser> <password> <quota> <domain>
    passwdpop <popuser> <password> <quota> <domain>
    delpop <popuser> 0 <domain>
    editquota <popuser> <domain> <quota>
    listlists
    addlist <listname> <password> <domain> <rebuildonly>

  8. #8
    Member
    Join Date
    Mar 2007
    Posts
    27

    Default

    So I cannot add a forwarder with cpanel-email then?

  9. #9
    Member
    Join Date
    Mar 2007
    Posts
    27

    Default

    nothing from that seems to work at all.
    I never get any output even from listlists.
    When i create a user like so /usr/local/cpanel/cpanel-email testuser password 0 domain.tld
    nothing shows up in the web interface. If i create a user in the webinterface I cant delete the email user from the commandline with delpop either.

    [edit]
    After reading /scripts/addpop i see that it was using the user env variable so after changing to the domain user and trying again it seems to work.
    Last edited by cmdln; 07-18-2007 at 11:07 PM. Reason: updating information

Similar Threads & Tags
Similar threads

  1. Subdomains and Domain Forwarders for multiple parked domains
    By GoWilkes in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-05-2011, 05:06 PM
  2. Automatic Subdomains and Parked Domains
    By arharp in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-04-2008, 12:05 PM
  3. Parked domains had subdomains, but no more.
    By Immortal in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-06-2005, 07:02 AM
  4. subdomains & parked domains not all showing in WHM
    By knipper in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-15-2003, 02:31 PM
  5. Email with domains that are parked on subdomains
    By PeterL in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-02-2002, 01:32 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube