books
Free Books / Computers / Practical mod_perl /

previous page: 5.8.3.1. Disabling code running under Apache::Registry
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 5.8.3.3. Disabling services with help from the frontend server

5.8.3.2. Disabling code running under other handlers




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

Under non-Apache::Registry handlers, you need to modify the configuration. You must either point all requests to a new location or replace the handler with one that will serve the requests during the maintenance period.

Example 5-2 illustrates a maintenance handler.

Example 5-2. Book/Maintenance.pm

package Book::Maintenance;

use strict;
use Apache::Constants qw(:common);

sub handler {
  my $r = shift;
  $r->send_http_header("text/plain");
  print qq{We regret that the service is temporarily
           unavailable while essential maintenance is undertaken.
           It is expected to be back online from 12:20 GMT.
           Please be patient. Thank you!};
  return OK;
}
1;

In practice, the maintenance script may well read the "back online" time from a variable set with a PerlSetVar directive in httpd.conf, so the script itself need never be changed.

Edit httpd.conf and change the handler line from:

<Location /perl>
    SetHandler perl-script
    PerlHandler Book::Handler
    ...
</Location>

to:

<Location /perl>
    SetHandler perl-script
    #PerlHandler Book::Handler
    PerlHandler Book::Maintenance
    ...
</Location>

Now restart the server. Users will be happy to read their email for 10 minutes, knowing that they will return to a much improved service.

 

Continue to:

  • prev: 5.8.3.1. Disabling code running under Apache::Registry
  • Table of Contents
  • next: 5.8.3.3. Disabling services with help from the frontend server

Books by Stas Bekman:















TOP
previous page: 5.8.3.1. Disabling code running under Apache::Registry
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 5.8.3.3. Disabling services with help from the frontend server

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com