.pdf)
WHM Plugins
example.com, you could use a hostname such as server1.example.com, but not example.com itself.
sethostname function from within your custom script:
/xml-api/sethostname function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/xml-api/sethostname
sethostname function from within your custom script:
/json-api/sethostname function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/json-api/sethostname
sethostname function takes the following required variable as input: sethostname function. sethostname call.
1 — success.
0 — failure.
https://example.com:2087/xml-api/sethostname?hostname=host.example.com in WebHost Manager will result in output similar to the following:
<sethostname>
<sethostname>
<msgs>Updating Apache configuration
Updating Internal cPanel Information.....
Done</msgs>
<status>1</status>
<statusmsg>Hostname Changed to: host.example.com</statusmsg>
<warns>main::runapp() called at whostmgr/bin/xml-api.pl line 583</warns>
</sethostname>
</sethostname>
https://example.com:2087/json-api/sethostname?hostname=host.example.com in WebHost Manager will produce output similar to:
{
"sethostname":[
{
"status":1,
"statusmsg":"Hostname Changed to: host.example.com",
"msgs":"Updating Apache configuration\nUpdating Internal cPanel
Information....\n.\nDone",
"warns":[
"\tWhostmgr::XMLUI::Hostname::sethostname('hostname', 'host.example.com')
called at whostmgr/bin/xml-api.pl line 133\n",
]
}
]
}