-3

In the command line if I do this:

ps -u root | less

one of the lines is this

19974 ?        00:00:01 httpd

is this safe, to have the main httpd process as running as root? if i do this : 'ps auxf | less' it looks like it spawns sub processes

4 Answers 4

4

Not only is it safe, it's required if you want to run on port 80. Per the docs:

If the Listen specified in the configuration file is default of 80 (or any other port below 1024), then it is necessary to have root privileges in order to start apache, so that it can bind to this privileged port.

1

httpd has to initially run as root, so yes, this is fine as long as you have a bunch of httpd process that are not running as root.

0

Yes. Apache, more specifically the parent process, needs to run as root to allow it to listen on the privilaged port 80

0

Due to its "nature", httpd normally would use port 80.

Only root can bind ports <1024 to any process.

You'll find this behaviour on other processes as well, e.g. services which uses udp & tcp-ports below 1024

You must log in to answer this question.