File: README

package info (click to toggle)
libapache2-reload-perl 0.13-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 212 kB
  • sloc: perl: 339; makefile: 19; sh: 5
file content (110 lines) | stat: -rw-r--r-- 3,256 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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.

  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