I'm trying to create a WHM / Plesk Type Control Panel for my Clients to use. I am running XAMPP on a VPS and want users to be able to, for example, ban IP's however for the change to take effect Apache needs to be restarted.
Is there a way using PHP the user can click a button and the Apache Service will restart?
I have tried using the following PHP code but all this does is Stop the Apache Server, it doesn't bring it back up?
<?php shell_exec("apache_stop.bat"); ?>
<?php shell_exec("apache_start.bat"); ?>
Both bat files are in the same directory as the php file and I have amended them so that the files are relative to them by adding this ..\..\ to the file paths.
Is there one file that I can run that will do both tasks automatically or is there a better way to do this?
After you stop apache, it exit and do not start second job. You may use script that get this two jobs