Stopping and starting Apache on Unix-like systems is done using the command line. As far as Windows is concerned, the server can be stopped using a special graphical or console utility called httpd. If you are using an off-the-shelf XAMPP build, Apache can be disabled through the control panel.
To stop Apache on Linux open Terminal (Applications - Standard - Terminal) and enter the command:
To restart, it is enough to enter a similar request, but with the start parameter:
To stop the process immediately, you can use the –k switch:
apachectl –k stop
Upon receiving this signal, the parent process immediately kills all child processes, and then exits itself.
For a soft restart of Apache, use the graceful parameter, for a hard restart, use restart:
apachectl –k graceful
apachectl –k restart
If the above commands do not work, then try shutting down the server with the kill or killall commands, but remember that each time they are used, the process is defeated.
In Windows, go to Command Prompt (Start - Accessories - Command Prompt) and type:
cd "C: \ path to the installed server \ bin"
httpd –k shutdown
To automatically shutdown Apache, create a Stop.bat file (right mouse button - New) and write:
cd \ path_to_apache \ bin
start Apache.exe –k shutdown
Save all changes. Now you can shut down the service by double clicking on this file.
If you are using the XAMPP build as a local server, then Apache can be shut down through the Control Panel. Go to Start Menu - All Programs - XAMPP for Windows - XAMPP Control Panel. In the window that opens, opposite the Apache item, click the Stop button. To restart, use the Start button. If you want to start in service mode, do not forget to check the box next to Svc.
If you are using a ready-made assembly of Denwer, then to stop the server operation, use the Stop Server shortcut on the desktop. To restart, double click on the Restart Server shortcut.