Apache::Reload



Apache::Reload

NAME
SYNOPSIS
DESCRIPTION
PSUEDOHASHES
AUTHOR
MAINTAINERS
SEE ALSO

NAME

Apache::Reload − Reload changed modules

SYNOPSIS

In httpd.conf:

  PerlInitHandler Apache::Reload
  PerlSetVar ReloadAll Off

Then your module:

  package My::Apache::Module;
  use Apache::Reload;
  sub handler { ... }
  1;

DESCRIPTION

This module is two things. First it is an adaptation of Randal Schwartz’s Stonehenge::Reload module that attempts to be a little more intuitive and makes the usage easier. Stonehenge::Reload was written by Randal to make specific modules reload themselves when they changed. Unlike Apache::StatINC, Stonehenge::Reload only checked the change time of modules that registered themselves with Stonehenge::Reload, thus reducing stat() calls. Apache::Reload also offers the exact same functionality as Apache::StatINC, and is thus designed to be a drop-in replacement. Apache::Reload only checks modules that register themselves with Apache::Reload if you explicitly turn off the StatINC emulation method (see below). Like Apache::StatINC, Apache::Reload must be installed as an Init Handler.

StatINC Replacement
To use as a StatINC replacement, simply add the following configuration to your httpd.conf:

  PerlInitHandler Apache::Reload

Register Modules Implicitly
To only reload modules that have registered with Apache::Reload, add the following to the httpd.conf:

  PerlInitHandler Apache::Reload
  PerlSetVar ReloadAll Off
  # ReloadAll defaults to On

Then any modules with the line:

  use Apache::Reload;

Will be reloaded when they change.

Register Modules Explicitly
You can also register modules explicitly in your httpd.conf file that you want to be reloaded on change:

  PerlInitHandler Apache::Reload
  PerlSetVar ReloadAll Off
  PerlSetVar ReloadModules "My::Foo My::Bar Foo::Bar::Test"

Note that these are split on whitespace, but the module list must be in quotes, otherwise Apache tries to parse the parameter list.

Un-Register Modules Explicitly
If ReloadAll is set to On, then you can explicity force a module not to be reloaded with

  no Apache::Reload;

A warning will appear in the error log that the file has changed, but will not be reloaded

Special "Touch" File
You can also set a file that you can touch() that causes the reloads to be performed. If you set this, and don’t touch() the file, the reloads don’t happen. This can be a great boon in a live environment:

  PerlSetVar ReloadTouchFile /tmp/reload_modules

Now when you’re happy with your changes, simply go to the command line and type:

  touch /tmp/reload_modules

And your modules will be magically reloaded on the next request. This option works in both StatINC emulation mode and the registered modules mode.

PSUEDOHASHES

The short summary of this is: Don’t use psuedohashes. Use an array with constant indexes. Its faster in the general case, its more guaranteed, and generally, it works.

The long summary is that I’ve done some work to get this working with modules that use psuedo hashes, but its still broken in the case of a single module that contains multiple packages that all use psuedohashes.

So don’t do that.

AUTHOR

Matt Sergeant, matt@sergeant.org

MAINTAINERS

the mod_perl developers, dev@perl.apache.org

SEE ALSO

Apache::StatINC, Stonehenge::Reload






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.