I have installed apache2 under ubuntu 12.04.

First

I read the differences about mpm worker and prefork. in my case it is in worker. In my apache2.conf I have :

<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

And a grep -ef | grep apache2 gives :

root      1189     1  0 13:14 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1192  1189  0 13:14 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1194  1189  0 13:14 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1195  1189  0 13:14 ?        00:00:00 /usr/sbin/apache2 -k start

And I don't understand why there are 4 processes and why 1 is owned by root and the others by www-data.

Second

I also read it was not a good idea to set the /var/www with www-data as owner and group. But I don't understand why ?

The good way would be to leave root as owner with full rights and the group to www-data with rx rights. It's right ?

Root is the most secure

Using root will keep any malware (People say linux cant get virus's but it might and it's good to be secure) from taking over your apache server, because root is a seperate account with extreme privileges. Long story short just keep it in root.

  • Sorry, but the opposite is true. The root account has the most privileges of all. If you're root on a machine, you can do just about anything - reading, changing or deleting any data, transferring any data to anywhere, using any resources of the machine and so on. When a program (technically, a process) is started, it normally gets the privileges of the user that has started it. If user 'joe' starts a program, it may do everything that 'joe' can do. If 'root' starts a program, it may do everthing that 'root' can do - which is, as I said, just about everything. So only use root if you have to. – Henning Kockerbeck May 25 '14 at 15:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.