I have a script server side (both a shell and a python script) that can restart Apache and do some other cleanup I need. However, I want to expose a webhook, so when my repository is updated, then Apache will be restarted. 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.
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.
To illustrate what I'm looking for:
- i commit changes to my repository
- the repository system calls a url like htpp://myserver.com/postwebhook
- the postwebhook URL calls a script on the server that restarts apache
- the postwebhook URL returns a 200 status
Anybody have this working and can share how they set it up?