github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

purcell / maintenance_server

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Click here to lend your support to: maintenance_server and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rails plugin providing a fallback server for mongrel — Read more

  cancel

http://www.sanityinc.com/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix name in licence 
Steve Purcell (author)
Sat Nov 17 01:42:50 -0800 2007
commit  4c0f5173311d78b6bc8035570e70b99b617d2352
tree    ca570b11fbd3acf993995d0f36589bd8fd449b80
parent  5e64a0aadeac73d5b07d50a0cf4453bc6e2a8742
maintenance_server /
name age
history
message
file MIT-LICENSE Loading commit data...
file README
file Rakefile
file about.yml
file install.rb
directory lib/
file uninstall.rb
README
MaintenanceServer
=================

It is assumed that your web application is a mongrel cluster running
behind Pound, Pen, or another load balancing program that can be
configured to use an 'emergency' back-end for when all regular
back-ends fail.

This plugin provides a lightweight 'maintenance' server to act as that
emergency back-end for when your Rails app is down for maintenance, or
due to a fatal error.

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).

The plugin's home on the web is here:

   http://git.sanityinc.com/?p=maintenance_server.git;a=summary

The plugin is discussed in blog articles here:

   http://www.sanityinc.com/

Send feedback or patches by email to steve@sanityinc.com


Example
=======

Install the plugin as usual.  If you do not install it with either
script/plugin or rapt, then be sure to run the install.rb script
manually.

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:

  ./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 \
    ...



Copyright (c) 2007 Steve Purcell, released under the MIT license
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server