我如何对变化的mod_perl重载源文件? [英] How do I have mod_perl reload source files on change?
问题描述
我开发与mod应用_
Perl和每一次我改变code是一个巨大的拖累重新启动服务器。我想仍然使用MOD _
perl的发展,因为这是我计划使用的实时服务器。我没有看到有关如何做到这一点的文档中任何事情。
I am developing an application with mod_
perl and restarting the server every time I change code is a huge drag. I'd like to still use mod_
perl for development because it's what I plan on using for the live server. I didn't see anything in the documentation about how to do this.
思考?
推荐答案
我想的Apache2 ::刷新会有所成就,你在找什么。但是,请记住要删除所有这个实现一次你准备投入生产应用。
I think Apache2::Reload will somewhat accomplish what you're looking for. However, remember to delete all this implementation once you're ready to put the app in production.
监测所有模块%INC
要监测和请求的处理开始重新放入%INC的所有模块,只需将下面的配置添加到您的httpd.conf:
To monitor and reload all modules in %INC at the beginning of request's processing, simply add the following configuration to your httpd.conf:
PerlModule Apache2::Reload
PerlInitHandler Apache2::Reload
在使用连接器和协议模块的Apache2 ::刷新应该在pre_connection阶段被调用工作:
When working with connection filters and protocol modules Apache2::Reload should be invoked in the pre_connection stage:
PerlPreConnectionHandler Apache2::Reload
注册模块含蓄
要只重装已用的Apache2 ::刷新注册模块,添加以下到httpd.conf:
To only reload modules that have registered with Apache2::Reload, add the following to the httpd.conf:
PerlModule Apache2::Reload
PerlInitHandler Apache2::Reload
PerlSetVar ReloadAll Off
# ReloadAll defaults to On
然后用线路上的任何模块:
Then any modules with the line:
use Apache2::Reload;
当他们改变
将重新加载。
Will be reloaded when they change.
有关的信息,请查看本文档页面 。希望这有助于。
For for information check out this documentation page. Hope this helps.
这篇关于我如何对变化的mod_perl重载源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!