restartVHost()
61
If the call fails, the server sends a reply information object with a
level
property of
error
and a
code
property of
NetConnection.Admin.Command.Failed
or a more specific value, if
available. Some objects might also have a
description
property that contains a string
describing the cause of the failure.
Description
Restarts a virtual host that is currently running. Restarting a virtual host disconnects all
connected users, unloads all currently loaded applications, and reloads the configuration files
for that virtual host.
If you make changes to the configuration files for a virtual host, you can use this command to
restart the virtual host without restarting the server.
Users must reconnect each time you restart a virtual host. Before using this command, you
might want to take steps to notify connected users.
Virtual host administrators can only restart the virtual hosts to which they are connected.
You must be a server administrator to start a virtual host other than the one to which you’re
connected.
Example
The following example shows a call to restart the connected virtual host and then a call to
restart a specified virtual host
tree.oak.com
on the default adaptor:
/* Restart the connected virtual host */
nc.call("restartVHost", new onRestartVHost());
/* Restart the virtual host tree.oak.com on the default adaptor. */
nc.call("restartVHost", new onRestartVHost(), "_defaultRoot_/
tree.oak.com");
See also
reloadApp()
,
startVHost()
,
stopVHost()
TIP
To start a virtual host that is stopped, use the
startVHost()
command. You must be a
server administrator to perform this command.