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.

Run script on Domain/Sub-domain creation.

Discussion in 'General Discussion' started by devonblzx, Jan 10, 2008.

  1. devonblzx

    devonblzx Member

    Joined:
    Feb 16, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I am using my own mod_fcgid build with a wrapper so I can execute php scripts on a per-user basis and add a custom phpini if needed.

    Now, since it uses a wrapper on a per-user basis, I need to have a file in the public_html directory in order for it to run properly.

    So how can I run a script when a new domain or sub-domain is created? I tried searching the forum without luck, anyone have experience with doing this?

    (The script I'm going to run is just going to copy the wrapper to the new public_html directory and chown/chmod it to the correct permissions)

    Thanks in advance!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If this is going to be on a per-user basis rather than a per-domain/subdomain basis, you can insert your hook code into /scripts/postwwwacct

    Details on how to do this are available at: http://www.cpanel.net/support/docs/hooks.htm

    If you wish to have a hook for any domain/sub-domain creation, you may wish to refer to this document on how to set up hooks for these functions:

    /usr/local/cpanel/hooks/README
     
  3. hekri

    hekri Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    149
    Likes Received:
    2
    Trophy Points:
    18
    The same question how to do that hook?

    When user add subdomain or addon domain we must put file to the new domain (subdomain) folder. php.ini for that domain...
     
Loading...

Share This Page