Answer the question
In order to leave comments, you need to log in
How to reload Apache from php?
How to soft reload Apache2 from php?
I found a solution that worked for someone as they write, but it does not work for me'apachectl -k graceful');
exec(
Answer the question
In order to leave comments, you need to log in
I join the Arhimed96 nonsense - how to cut the branch on which you sit?
But everything is possible. One of many solutions: To do this, you need to write a shell script with a reboot and give it permission to run with sudo for the www-data user in the /etc/sudoer file. Type in the apache search engine www-data sudoer
If php is not running as root - no way.
Option - we make a listener and run it as root, and we already give him commands to reboot.
The most important crutch - we write sh with a cycle and sleep every 5 seconds, which checks the file /tmp/apache_reboot for 1.
If the file is 0 - we fall asleep for 5 seconds, if 1 - we do a reboot and change 1 to 0.
The answer will be ridiculous, like the question itself, but you can listen to some port through a sh-script (launched as root), when accessed with a password, Apache will reboot.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question