-2

I have a question abut the Apache Web Server running over XAMPP: Why it uses two PIDs and two ports?

enter image description here

Thanks in advance for your help!

InfZero
  • 113
  • 1
  • 3
  • 1
    What problem are you trying to solve, why is this a concern for you? – Shane Madden Nov 26 '14 at 02:45
  • 2
    About 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. –  Nov 26 '14 at 03:02
  • @AndréDaniel, so the PIDs are assigned to manage each port? – InfZero Nov 26 '14 at 03:09
  • 2
    About 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. –  Nov 26 '14 at 03:11
  • 2
    There is no correlation between the number of ports and number of processes in use by apache. – Andrew Domaszek Nov 26 '14 at 03:27

1 Answers1

5

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.

enter image description here

If you checked which PID was listening on the ports for the above system it would be PID 10699.

Brian
  • 3,476
  • 18
  • 16