Can't execute the command from a script like apacheRestart.sh
anthlasserre opened this issue · comments
I've an issue concerning a script like" apacheRestart.sh".
I made the link between the action button on the web interface "Restart Apache", and in the log of Apache an error shows I'm not authorized to restart apache2.service.
I have to find a way to execute this command "systemctl restart apache2" in my script "apacheRestart.sh" with root privileges.
Momentally solved with the add of "sudo" command on Debian.
I added the user "www-data" in the file /etc/sudoers and attributed NOPASSWD and ALL (for the moment).
Now when I launch the action from the configuration.php page, it's work fine.
But I have to find a better way to display instantly the action. Exemple when Apache is restarting, show in the configuration.php page, a loading and an OK when Apache is restarted.