Why Apache uses two PIDs and two ports?
8,927
In general Apache has a main privileged process that spawns other less privileged processes as needed that it passes off the requests to for processing. How many depends on the Apache version, the selected process model and configuration settings.
The two default ports apache listens on are HTTP (80) and HTTPS (443) both of which the main process listens on.
Viewing the process tree in a utility like htop
highlights the relationship. The default for Centos 7 is show below.
If you checked which PID was listening on the ports for the above system it would be PID 10699.
Related videos on Youtube
Comments
-
InfZero over 1 year
I have a question abut the Apache Web Server running over XAMPP: Why it uses two PIDs and two ports?
Thanks in advance for your help!
-
ravi yarlagadda over 9 yearsWhat problem are you trying to solve, why is this a concern for you?
-
Admin over 9 yearsAbout the two ports it's obvious, the first seems to be an HTTP port (derived from the standard 80 port), the second one is the HTTPS port.
-
InfZero over 9 years@AndréDaniel, so the PIDs are assigned to manage each port?
-
Admin over 9 yearsAbout the two PIDs it's most likely a control process that listens for connections and then spawns worker processes as the requests arrive, in this case there is only one worker process since the load is very low.
-
Andrew Domaszek over 9 yearsThere is no correlation between the number of ports and number of processes in use by apache.
-