2

When I do ps -aux, why do I have one copy of httpd running as root and the rest as apache?

ps -aux | grep httpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root      2820  0.0  1.1 126740 13372 ?        Ss   10:23   0:00 /usr/sbin/httpd
apache    2822  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2823  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2824  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2825  0.0  0.5 126804  6460 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2826  0.0  0.5 126804  6460 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2827  0.0  0.5 126740  6272 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2828  0.0  0.5 126740  6276 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2829  0.0  0.5 126740  6276 ?        S    10:23   0:00 /usr/sbin/httpd
root      3505  0.0  0.0   5460   744 pts/0    R+   11:27   0:00 grep httpd
Mughil
  • 1,949

1 Answers1

6

Because your Apache configuration includes:

User apache

Apache needs to be root in order to bind to low-numbered ports (such as 80 and 443). Once the port is open, Apache changes to a less-privileged user in order to limit access to your system in the event of a security compromise.

larsks
  • 44,886
  • 15
  • 124
  • 183