Apache comes by default as mpm-prefork.
But you will want to instead use mpm-worker, as it will use less memory and be more efficient.
To use the “worker” MPM with PHP, do the following:
Step 1. Stop the apache2 daemon
sudo /etc/init.d/apache2 stop
Step 2. Uninstall apache2-mpm-prefork
sudo aptitude remove apache2-mpm-prefork
Step 3. Install apache2-mpm-worker and apache2-threaded-dev
sudo aptitude install apache2-mpm-worker apache2-threaded-dev
Step 4. Enable CGI and mod_actions (may already be enabled)
sudo a2enmod cgid
2
sudo a2enmod actions
Step 5. Create a file in /etc/apache2/conf.d with the following content (I called mine php5-cgi.conf):
<IfModule mod_actions.c>
2
Action application/x-httpd-php /cgi-bin/php5
3
</IfModule>
Step 6. Start the apache2 daemon
sudo /etc/init.d/apache2 start
Another way is this way by PCJonathan