maybe the cpanel staff can provide the hook so we can play with itIt isn't hard to do the only problem is getting a supported post hook to have new accounts have their own .conf file in the nginx configuration directory and just include every file in there.
What cPanel/WHM function(s) do you need to hook? There is a possibility we may already offer the ability to do post hooks on the functionality you need to hook.It isn't hard to do the only problem is getting a supported post hook to have new accounts have their own .conf file in the nginx configuration directory and just include every file in there.
add new account, domain parking, domain addon, domain forwardingWhat cPanel/WHM function(s) do you need to hook? There is a possibility we may already offer the ability to do post hooks on the functionality you need to hook.
Let me introduce you to ..add new account, domain parking, domain addon, domain forwarding
we need the hook to reload the script to generate new vhost.conf for nginx![]()
what i'm affraid is if there is a trouble if restarting nginx every 5 minutesLet me introduce you to ..
/scripts/postwwwacct
That's for after creating a new account.
For the others, I'm sure cPanel has something in place or you can dig for that yourself.
If they don't offer it, you could easily have a cronjob that runs every 5 minutes for the others.
You can find some more information on /scripts/postwwwacct at:add new account, domain parking, domain addon, domain forwarding
we need the hook to reload the script to generate new vhost.conf for nginx![]()
how to adding it so if anyone adding a domain name it will run nginx.sh to regenerate the file vhost.confYou can find some more information on /scripts/postwwwacct at:
ScriptHooks < DevHooks < TWiki
Domain parking, addon domains and domain forwarding are handled by cPanel API functions. Part of this API architecture is the ability to create function hooks to execute your own shell script after these functions are executed. You can read more about this at:
Hooking into cPanel Functionality
We have some documentation on the Addon Domains API functions at: AddonDomainRef < DeveloperResources/ApiRef < TWiki
We have documentation on Park Domains API functions at:
ParkRef < DeveloperResources/ApiRef < TWiki
The API 1 function call for adding a redirect (as used by the cPanel interface) is:
<cpanel Mime="add_redirect(path, type, url, domain, wildcard, rdwww)">
Mime is the module name
add_redirect is the function name
path is the path within the URL to redirect (if any)
type is either temp or permanent
url is the URL to redirect to
domain is .* if ** All Public Domains ** is selected, otherwise it is the domain/addon domain/etc to redirect.
wildcard is: 1 if this is a wildcard redirect
rdwww is: 2 if "Only redirect with www. " is selected, 0 if "Redirect with or without www." is selected, or 1 if "Do Not Redirect www." is selected.
So anyone want to share the cpanel hook for reloading vhost.conf file when a user using addon domain, domain parking, etc ?I have moved our discussion about APIs and Hooks to a new thread in the cPanel/WHM Developer Discussions forum, where you are likely to receive more relevant feedback.
<cpanelif !$CPERROR{'addondomain'}>
<cpanel print="$FORM{'domain'}"> <cpanel langprint="AODCreateYes">!<br />
<!-- <cpanel Ftp="addftp($FORM{'user'},$FORM{'pass'},$FORM{'dir'},,,$FORM{'dir'})"> -->
<!-- If you would like to create an ftp account to upload files to this new domain, you can do so here: <a href="../ftp/addftp.html?domain$
<br/> <cpanel langprint="AODGoFileMgr">: <a target="_blank" href="../files/index.html?dir=<cpanel print="$homedir">/<cpanel print="$FORM{'d$
</cpanelif>
<cpanelif !$CPERROR{'addondomain'}>
<cpanel langprint="AODAddedPre"> <cpanel print="$FORM{'domain'}"> <cpanel langprint="RDRedRemText">!
<br /><cpanel Ftp="delftp($FORM{'domain'})">
</cpanelif>
Modifying the theme files will not accomplish what you want. DavidG earlier linked to our integration documentation. Please read the documents pertaining to 'hook' abilities.currently i know the file responsible for domain addon add and domain addon deleting which is doadddomain.html and dodeldomain.html.
is there any sample how to use the hook ?Modifying the theme files will not accomplish what you want. DavidG earlier linked to our integration documentation. Please read the documents pertaining to 'hook' abilities.
Please carefully review the documentation; this will be the best resource to help learn. If you have specific questions about something feel free to ask; however, if you need assistance creating something I would consider locating and hiring someone to develop the solution for you.is there any sample how to use the hook ?
i really newbie here about cpanel hook and really don't know what i must do and how to use the hook![]()
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
H | Redirect customer website using apache or nginx directive via API | Developer Experience | 1 | |
K | Hooking into domain processes | Developer Experience | 1 | |
P | Hooking into mail handler | Developer Experience | 2 | |
![]() |
Hooking into a addon or subdomain event | Developer Experience | 2 |