Practical mod_perl / HTML Book /



previous page: 5.8.3.3. Disabling services with help from the frontend server
  
page up: HTML Version of the book
  
next page: 5.9. Three-Tier Server Scheme: Development, Staging, and Production

5.8.4. Scheduled Routine Maintenance


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:

  • prev: 5.8.3.3. Disabling services with help from the frontend server
  • Table of Contents
  • next: 5.9. Three-Tier Server Scheme: Development, Staging, and Production







TOP
previous page: 5.8.3.3. Disabling services with help from the frontend server
  
page up: HTML Version of the book
  
next page: 5.9. Three-Tier Server Scheme: Development, Staging, and Production


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


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

© 2007 StasoSphere.com