in reply to Control over apache processes

In addition to Apache::Reload, you can do this sort of thing by having your processes check periodically to see if your configuration file has changed. Just keep the last mtime of the file in a global and check if it's been updated since then, possibly in an early phase like PerlFixupHandler. If stat-ing the file makes you worry about performance, you can keep a last-checked time as well and only check it every 30 seconds.

Replies are listed 'Best First'.
Re^2: Control over apache processes
by ganeshk (Monk) on Aug 19, 2008 at 16:45 UTC

    In addition to Apache::Reload, you can do this sort of thing by having your processes check periodically to see if your configuration file has changed.

    Perrin, is it possible to make an Apache process(under mod_perl) do something like this? Basically if we try to achieve this by posting HTTP requests you never know if all the processes will be affected. Correct? So how would you make this periodic polling? Thanks very much for the replies.

    Thanks,
    Ganesh

      Yes, mod_perl is what I'm talking about here (although you could do something similar in any persistent environment). You don't need to contact all processes at once -- you just need them to check for this when they do get a request. In other words, make all of your processes check at the beginning of any new request for a change in their environment and take action if they discover one.