webctl
Scriptable Web Site Management
Overview
webctl is a web site management tool that performs actions on Virtual Servers such as starting or stopping them, and provides reporting facilities. webctl is completely cluster aware and transparently handles deployment of configuration information across the server farm. webctl is used by the adminserver interface to provide the 'traffic light' functionality, is completely scriptable and provides many powerful facilities for automating web site provisioning.Simple Usage
The webctl program is can be found on the adminserver machine at $ZEUSHOME/webadmin/bin/webctl.You will need to run webctl as the user that owns the Zeus Web Server installation, which is normally root.
In its simplest use, webctl can be used to start or stop a particular Virtual Server. For example:
$ webctl --action=start --vs=reseller
The above command will cause the Virtual Server reseller to be started on the web server (or multiple web servers in case of a clustered setup). The output of the command will look something like this:Virtual Server reseller - Success Successful start on backend machine localhost
To stop a Virtual Server, perform the following command:$ webctl --action=stop --vs=reseller
Another common task is to restart all the currently running Virtual Servers. For example you've written some provisioning scripts that manipulate the web server configuration files, and now you want to deploy those changes to all the running web servers in your server farm. Simply use:$ webctl --action=restart --allvs
If you are using Zeus in a clustered setup, and one of the machines in the cluster is down during a configuration update, it is simple to resynchronize the configuration of that machine with the rest of the cluster.
In its simplest form, the following command will resynchronize a web server machine with the exact configuration (including all the running Virtual Servers), that the other machines in the cluster are running:$ webctl --action=sync --machine=[machine name]
If you want to synchronize just a particular Virtual Server, or set of Virtual Servers, simply add a list of --vs=[xxx] arguments to the command, for example:$ webctl --action=sync --machine=localhost --vs=server1 --vs=server2
Advanced Usage
webctl is designed to be used as a scriptable configuration tool for use in automated provisioning systems. Coupled with a web server configuration file generator, it provides a complete solution for deploying configuration updates across a server farm, (For example, automating adding new customers on the hour from a cronjob, pulling the customer information out of a backend database; and starting the customer's web site automatically).
In the table below is a complete list of options that can be passed to the webctl program. This table can also be displayed by running 'webctl --help'.
Usage:./webctl <options> [--action=start|stop|restart|sync|ask|list|cells] - specifies the action to do [--vs=Virtual Server] - specify a Virtual Server to act on, this option can be used multiple times. (start|stop|restart|sync) [--dvs=dynamic Virtual Server] - specify a dynamically loaded virtual server (stop) [--allvs] - specifies all Virtual Servers (stop|start) specifies all running Virtual Servers (restart) [--alldvs] - specified all dynamically loaded Virtual Servers (stop) [--machine=machine] - specify machine (ask|sync) [--html] - HTML output [--quiet] - only display problems
--action=start Causes webctl to start the listed Virtual Servers (given via --vs or --allvs) on all the machines in the cluster. --action=stop Causes webctl to stop the listed Virtual Servers (given via --vs or --allvs) on all the machines in the cluster. --action=restart Causes webctl to restart the given Virtual Server(s) on all the machines in the cluster. If --vs is used then that particular Virtual Server will be restarted, if --allvs then all currently running Virtual Servers will be restarted. A 'restart' is defined as a 'stop' then a 'start' in this context.
--action=sync Causes webctl to synchronize the configuration of a particular web server machine specified via --machine with the master configuration files stored on the adminserver machine. This is useful if for example, one of your machines in the cluster has an outage and is taken out of the cluster, new web sites are added or modified, and then the failed machine is repaired and brought back into the cluster. This command allows you to quickly and simply resynchronize that machine with the subsequent configuration updates it missed.
If you want to synchronize just a particular Virtual Server, or set of Virtual Servers, simply add a list of --vs=[xxx] arguments to the command.
--action=ask Causes webctl to ask a particular web server machine specified via --machine which Virtual Servers it is currently running, and display them on stdout. --action=list Causes webctl to display a list of all the machines in the cluster it knows about. --vs=Virtual Server Specifies which Virtual Servers the actions 'start', 'stop', 'restart' and 'sync' should apply to. --dvs=Virtual Server Specifies which dynamic Virtual Servers the action 'stop' should apply to. A dynamic Virtual Server is one that is started by the dynamic server module. A special licence key is needed to enable this module. --allvs For actions 'start' and 'stop', this specifies all Virtual Servers should be started or stopped respectively. For action 'restart', this specifies all currently running Virtual Servers should be restarted. --alldvs For the action 'stop', this specifies all dynamic Virtual Servers should be stopped. This is useful when the configuration for the dynamic servers has changed. --machine=machine Specifies which machines the actions 'ask' and 'sync' should apply to. --html Specifies the output should be in HTML format. This option is used by the adminserver for example to display any errors generated by the 'traffic light page' in a nicely formatted manner. --quiet Specifies quiet mode. In quiet mode, output will only be generated by webctl if a problem occurs, otherwise no output will be generated.