Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, versions are Apache 2.2.16 with Linux Debian My config is (extract) : (...) <IfModule mpm_prefork_module> StartServers 1 MinSpareServers 1 MaxSpareServers 3 MaxClients 150 MaxRequestsPerChild 0 </IfModule> User www-data Group ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Dec 2008
    Location
    Luxembourg
    Posts
    136

    Apache: why so many 'root' processes as 'www-data' are expected ?


    Hello,

    versions are Apache 2.2.16 with Linux Debian

    My config is (extract) :
    (...)
    <IfModule mpm_prefork_module>
    StartServers 1
    MinSpareServers 1
    MaxSpareServers 3
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>

    User www-data
    Group www-data
    (....)


    Once I start the Apache server, only 'root' processes are created.
    After when I start some Apache application, 'www-data' are correctly created.
    So 'root' processes are not used ? I should only have *one* root process, correct ?

    (1) after Apache re-start .

    ps -ef | grep apache
    root 3400 1 9 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3408 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3409 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3410 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3411 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3412 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start


    After start of Apache application, processes www-data are created, but so root are not used, correct ? So what are the root processes for ?

    (2) ps -ef | grep apache
    root 3400 1 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3408 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3409 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3410 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3411 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3412 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3420 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3422 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3423 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3428 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3436 3400 0 18:52 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3444 3436 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3447 3428 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3448 3411 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3449 3408 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3450 3409 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3451 3410 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3452 3400 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3453 3412 13 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 3454 3420 5 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3455 3400 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start
    root 3456 3400 0 18:53 ? 00:00:00 /usr/sbin/apache2 -k start


    Thanks for help and clarification.
    Bye,
    Bruno

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Its because you are binding to a port (80), in order to do that you have to be root. I guess that's why they call ports below 1023 "privileged ports"

    Its not going to actually run as root, it forks over to that user you specified (try connecting via browser and loading web pages).
    linux user # 503963

  3. #3
    Linux Newbie
    Join Date
    Dec 2008
    Location
    Luxembourg
    Posts
    136
    Yes, but why so many 'root' processes ?
    Only *one* should be needed to start the (might be many) 'www-data' processes. Indeed param 'StarServers = 1'
    All the *others* 'root' processes are apparently not used.

    Bruno

  4. #4
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    What about worker modules or any other modules? They may not all be for prefork processes.
    linux user # 503963

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •