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 ?