How do I update the mod_perl source files when changing?

I am developing an application with mod _ perl and restarting the server with every code change - this is a huge drag and drop. I would like to use mod _ perl for development, because this is what I plan to use for a live server. I have not seen anything in the documentation on how to do this.

Thoughts?

+6
perl apache mod-perl
source share
2 answers

I think Apache2 :: Reload will do a little what you are looking for. However, be sure to remove this entire implementation as soon as you are ready to host this application.

Monitoring all modules in% INC

To monitor and reload all modules in% INC at the beginning of request processing, simply add the following configuration to your httpd.conf:

 PerlModule Apache2::Reload PerlInitHandler Apache2::Reload 

When working with connection filters and protocol modules, Apache2 :: Reload should be started at the pre_connection stage:

 PerlPreConnectionHandler Apache2::Reload 

Register modules implicitly

To reload only modules registered in Apache2 :: Reload, add the following to httpd.conf:

 PerlModule Apache2::Reload PerlInitHandler Apache2::Reload PerlSetVar ReloadAll Off # ReloadAll defaults to On 

Then any modules with a line:

 use Apache2::Reload; 

Will reboot when they change.

Visit this documentation page for information . Hope this helps.

+9
source share

I use this solution from Perrin Harkins through PerlMonks:

Set MaxRequestsPerChild to 1, then load any potentially modifiable modules into the child, not the parent (obviously, only for development environments). Each request will go to a new child server, which will reload all your potentially changing modules.

From "The best way to see module changes on a running web server "

+2
source share

All Articles