[英]How do I restart apache from a webpage apache is serving?
I have a script server side (both a shell and a python script) that can restart Apache and do some other cleanup I need. 我有一个脚本服务器端(shell和python脚本),可以重新启动Apache并执行我需要的其他一些清理工作。 However, I want to expose a webhook, so when my repository is updated, then Apache will be restarted.
但是,我想公开一个Webhook,因此在更新我的存储库时,Apache将重新启动。 However, I am currently serving the URL that restarts Apache using Apache, and when the script stops Apache or kills its process, the rest of the script stops executing.
但是,我目前正在提供使用Apache重新启动Apache的URL,并且当脚本停止Apache或终止其进程时,脚本的其余部分将停止执行。
I've been looking all over the web for a guide on how to do this, and while there are a million scripts for restarting Apache, I can't find a guide on how to setup your Apache server so that the script will properly finish executing. 我一直在网上寻找有关如何执行此操作的指南,尽管有数百万个用于重启Apache的脚本,但找不到有关如何设置Apache服务器以使脚本正确完成的指南。执行。
To illustrate what I'm looking for: 为了说明我在寻找什么:
Anybody have this working and can share how they set it up? 任何人都可以使用此功能,并且可以分享如何设置它?
Script cannot continue while server is down (at least not as a script, it can start another process, change its group and not be killed by Apache on restart, but it won't be able to return result in any case). 服务器关闭时,脚本无法继续运行(至少不能作为脚本运行,它可以启动另一个进程,更改其组,并且在重新启动时不会被Apache杀死,但是无论如何都无法返回结果)。
Here is a workaround: 这是一种解决方法:
The similar approach is used by many wireless routers in their web interfaces. 许多无线路由器在其Web界面中使用了类似的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.