: Why has Apache begun running a single process as root, and another as root and the wwwdata user? I am running Apache Worker-MPM, PHP 5.3.2, and FCGID. Apache runs better than before, but
I am running Apache Worker-MPM, PHP 5.3.2, and FCGID.
Apache runs better than before, but I noticed that there is an apache process running as root and a second process that runs as both root and as wwwdata. The rest of the processes are running as wwwdata.
Has anyone run into this yet and is it safe?
More posts by @Fox8124981
1 Comments
Sorted by latest first Latest Oldest Best
Apache Httpd starts off as a process run by root to be able to listen to ports < 1024 (80 for HTTP and 443 for HTTPS). Normal users can't do that.
In addition, some configuration files are only readable by root, during the launch process. For example, your Apache user (e.g. www-data) shouldn't need to be able to read your private key file if you've configured SSL.
It's a good thing not to run everything as root: this way, a mistake or a compromised service wouldn't be able to make as much damage to the system as when running as root.
EDIT:
(I just assumed www-data instead of wwwdata, but it doesn't matter, it will run as the user you set it to run.)
Neither set of logs provides anything unusual. I have no idea how it's running that way.
It just runs this way: it starts a process as root and then forks other users as the user you've chosen.
If you get the root process id (e.g. with ps auwx | grep apache2, or grep httpd depending on the distribution), then run pstree -p -u THE_PROCESS_ID, you should see the hierarchy clearly. The parent process should always be running permanently (otherwise, you'd kill its child processes too).
See the User documentation (Apache MPM Common Directives):
If you do start the server as root, then it is normal for the parent
process to remain running as root.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.