Several Copies of Apache
To get a display of all the processes running, run:
% ps -aux
Among a lot of Unix stuff, you will see one copy of httpd belonging to root and a number that belong to webuser. They are similar copies, waiting to deal with incoming queries.
The root copy is still attached to port 80 — thus
its children will be as well — but it is not listening. This is
because it is root and has too many powers for this to
be safe. It is necessary for this
“master” copy to remain running as
root because under the (slightly flawed) Unix security
doctrine, only root can open ports below 1024.
Its job is to monitor the scoreboard where the other copies
post their status: busy or waiting. If there are too few waiting
(default 5, set by the MinSpareServers
directive
in httpd.conf ), the root
copy starts new ones; if there are too many waiting (default 10, set
by the MaxSpareServers
directive), it kills some
off. If you note the PID (shown by ps
-ax
, or ps
-aux
for a fuller listing; also to be found in
... /logs/httpd.pid ) of the root
copy and kill it with:
% kill
PID
you will find that the other copies disappear as well.
It is better, however, to use the stop script described in Section 2.3 earlier in this chapter, since it leaves less to chance and is easier to do.
Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.