Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member Silent Ninja's Avatar
    Join Date
    Apr 2006
    Location
    Buenos Aires, Argentina
    Posts
    173

    Question Parking a domain after account creation

    I need to create a script to park a domain like this on each new account:

    $cpaneluser.`hostname` (ie. user.server.example.com) => parked to the www domain

    So the users can access there as if it was their "alternate domain" (ie, if their dns's fail, or if they want to try the service before pointing their actual domains).

    I know I can do it with the /scripts/postwwwacct hook, but I haven't found any way to park a domain using bash. So I'm parking it manually for now.

    How can I park the domain automatically for it to work?

    PS EDIT: I've found /scripts/park but I'm not using it since it claims that it shouldn't be used ("!!!!!!!!!!!!! This script is deprecated and will be removed in future builds !!!!!!!!!!!!!")
    Last edited by Silent Ninja; 01-10-2012 at 03:46 PM.
    Silent Ninja
    "Practice Makes Perfect"

  2. #2
    Member Silent Ninja's Avatar
    Join Date
    Apr 2006
    Location
    Buenos Aires, Argentina
    Posts
    173

    Default Re: Parking a domain after account creation

    Recalling this thread, I've found this link http://forums.cpanel.net/f42/cpanel-...ks-125393.html which had some information about what I wanted, but the script just doesn't exist anymore on newer cPanel releases, there's onle these ones:

    /usr/local/cpanel/hooks/park/listaddondomains.example
    /usr/local/cpanel/hooks/park/listparkeddomains.example

    And also, both are empty files.

    Do you have any ideas on where are these scripts now?

    PS: I have cPanel RELEASE 11.30.5 (build 3) which should be the last version available
    Silent Ninja
    "Practice Makes Perfect"

  3. #3
    Member This forum account has been confirmed by cPanel staff to represent a vendor. KostonConsulting's Avatar
    Join Date
    Jun 2010
    Location
    Austin, TX
    Posts
    97
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Parking a domain after account creation

    You'll need to create those files (they can contain whatever scripts you want (PHP, Perl, Bash)) and then add them to the registered cPanel hooks using: /usr/local/cpanel/bin/register_hooks

    You may want to look at the new cPanel hooks system as /usr/local/cpanel/hooks only allows for one hook per function which could conflict with a plugin or future hook you may want to add:

    Basic Usage | Standardized Hooks
    Dave Koston
    Koston Consulting
    http://www.kostonconsulting.com

  4. #4
    Member Silent Ninja's Avatar
    Join Date
    Apr 2006
    Location
    Buenos Aires, Argentina
    Posts
    173

    Default Re: Parking a domain after account creation

    Ok, that seems to be what I was looking for, but I was hoping for a more easy way to learn, since...

    On every account creation, I should take the domain and user account that's being created, park the domain user[dot]`hostname` on top to show the same as the user's domain

    ... but how ?
    Silent Ninja
    "Practice Makes Perfect"

  5. #5
    Member This forum account has been confirmed by cPanel staff to represent a vendor. KostonConsulting's Avatar
    Join Date
    Jun 2010
    Location
    Austin, TX
    Posts
    97
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Parking a domain after account creation

    Quote Originally Posted by Silent Ninja View Post
    Ok, that seems to be what I was looking for, but I was hoping for a more easy way to learn, since...

    On every account creation, I should take the domain and user account that's being created, park the domain user[dot]`hostname` on top to show the same as the user's domain

    ... but how ?
    You'll need to know how to code to do that but you can learn if needed. Take the data you get in from the hook and call the cPanel API to park the domain:

    ApiPark < ApiDocs/Api2 < TWiki

    Your option on how to call the API:

    XML/JSON via HTTP: cPanel XML and JSON APIs

    Perl Library: (see /usr/local/cpanel/Cpanel/XML.pm)
    Dave Koston
    Koston Consulting
    http://www.kostonconsulting.com

Similar Threads & Tags
Similar threads

  1. Replies: 7
    Last Post: 07-23-2011, 08:53 PM
  2. apache locks when creating a new account or parking a domain
    By weblinxinc in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-20-2009, 11:29 PM
  3. Automatically parking domains on account creation
    By noyearzero in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-28-2008, 05:43 PM
  4. named.conf gets empty when creating account or parking domain
    By NNNils in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-09-2005, 12:42 PM
  5. New Account Creation - Domain doesn't resolve!!!
    By nitromax in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-19-2003, 10:25 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube