Maintenance Server plugin
Plugin details
Documentation
ruby script/plugin install http://rails.sanityinc.com/plugins/maintenance_server/
After installation, a new script/maintenance_server command is available, which runs a small (Mongrel) web server instance listening on the specified port.
The web server will serve files under RAILS_ROOT/public as usual,while unconditionally returning a "503 Unavailable" server response for any other request, and rendering a nice apologetic HTML page at RAILS_ROOT/public/maintenance.html (provided).
Example
=======
The installation will create a new 'script/maintenance_server' script, and a reasonable default 'unavailable' page at 'public/maintenance.html'.
Start the maintenance_server on the port of your choice, as follows:
ruby script/maintenance_server PORT
(You may want to use software such as daemontools or runit to ensure that the server is automatically started with your system and restarted if it fails or is killed.)
Given mongrel_rails back-ends on ports 8000, 8001 etc., and maintenance_server running on port 8020, sample configuration for Pound might look something like this:
ListenHTTP Address 0.0.0.0 Port 80 Service BackEnd Address 127.0.0.1 Port 8000 End BackEnd Address 127.0.0.1 Port 8001 End ... # other back-ends here Emergency Address 127.0.0.1 Port 8020 End End End
In the same scenario, one might start the excellent Pen load-balancer with the following command-line:
pen -f -r -b 5 -e localhost:8020 \ localhost:80 \ localhost:8000 localhost:8001 localhost:8002 \ ...
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: Guest, 11 months ago

