简体   繁体   English

通知mod_perl应用程序apache服务器已重新启动

[英]Inform mod_perl application that the apache server has restarted

What's the best way (assuming there is one) to inform a mod_perl application that the apache web-server it's running under recently restarted? 通知mod_perl应用程序最近正在重启的apache Web服务器正在运行的最佳方法是什么(假设有一种方法)?

I ask because when I restart the server I'd like to clear memcached, however in that case, I need to inform the application that memcached has reset so that the application can initialise the data again. 我问是因为重启服务器时我想清除memcached,但是在这种情况下,我需要通知应用程序memcached已重置,以便应用程序可以再次初始化数据。

You can put this sort of logic in a startup file. 您可以将这种逻辑放入启动文件中。 This file will be executed on Apache (re)start. 该文件将在Apache(重新)启动时执行。 In your Apache config: 在您的Apache配置中:

 PerlPostConfigRequire /home/httpd/perl/lib/startup.pl

More info at http://perl.apache.org/docs/2.0/user/handlers/server.html#Startup_File 有关更多信息,请访问http://perl.apache.org/docs/2.0/user/handlers/server.html#Startup_File

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM