webctl
Scriptable Website Management
Overview
webctl is a website 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 website 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 Webserver 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 webserver (or multiple webservers in case of a clustered setup). The output of the command will look something like this:
VirtualServer 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 webserver configuration files, and now you want to deploy those changes to all the running webservers 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 webserver machine with the exact configuration (including all the running virtualservers), that the other machines in the cluster are running:
$ webctl --action=sync --machine=[machine name] If you want to synchronize just a particular virtualserver, or set of virtual servers, simply add a list of --vs=[xxx] arguments to the command, e.g.
$ 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 webserver configuration file generator, or provides a complete solution to deploying configuration updates across a server farm, (e.g. automating adding new customers on the hour from a cronjob, pulling the customer information out of a backend database; and starting the customer's website 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 [--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) [--allvs] - specifies all virtual servers (stop|start) specifies all running virtual servers (restart) [--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 webserver 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 websites 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 virtualserver, or set of virtual servers, simply add a list of --vs=[xxx] arguments to the command.
--action=ask Causes webctl to ask a particular webserver 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, including both backend webservers and any frontend Zeus Load Balancer machines. (Zeus Load Balancer is completely integrated into the administration facilities of Zeus Server). --action=cells If Zeus Load Balancer is installed, this causes webctl to display information on how the load is currently being distributed between the backend machines, and information on the average response time of each backend machine. --vs=virtual server Specifies which virtual servers the actions 'start', 'stop', 'restart' and 'sync' should apply to. --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. --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.