What can cause httpd to start automatically after stopping it?
In a bash script I need to first stop apache web server. This is the script:
apachectl stop; while pgrep httpd; do sleep 1; done echo "[Apache server stopped]"
When I run the script it prints running apache processes until there isn't any running process and prints [Apache server stopped]
Then running the command
pgrep httpd prints nothing, but if I enter a website hosted by the server, then
pgrep httpd prints some httpd processes.
Is this the right way to stop apache? Why does it start automatically after running
apachectl stop? If it is related to KeepAliveTime, how do I force the running child processes to stop?
Edit: This is also true for running
service httpd stop or
apachectl stop commands in command line.