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