This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl
If maintenance tasks can be scheduled when no one is using the server, you can write a simple PerlAccessHandler that will automatically disable the server and return a page stating that the server is under maintenance and will be back online at a specified time. When using this approach, you don't need to worry about fiddling with the server configuration when the maintenance hour comes. However, all maintenance must be completed within the given time frame, because once the time is up, the service will resume.
The Apache::DayLimit module from http://www.modperl.com/ is a good example of such a module. It provides options for specifying which day server maintenance occurs. For example, if Sundays are used for maintenance, the configuration for Apache::DayLimit is as follows:
<Location /perl>
PerlSetVar ReqDay Sunday
PerlAccessHandler Apache::DayLimit
</Location>It is very easy to adapt this module to do more advanced filtering. For example, to specify both a day and a time, use a configuration similar to this:
<Location /perl>
PerlSetVar ReqDay Sunday
PerlSetVar StartHour 09:00
PerlSetVar EndHour 11:00
PerlAccessHandler Apache::DayTimeLimit
</Location> 
Continue to: