Archive for August, 2011

Transparent switching from apache2-mpm-prefork to apache2-mpm-worker (Debian Squeeze)

August 25, 2011 Leave a comment

If you install this configuration in /etc/apache2/conf.d + libapache2-mod-fcgid, then you can use either version of apache2 with php5.

First add the programs indicated and then add the script below to  /etc/apache2/conf.d:

apt-get install apache2-mpm-worker  libapache2-mod-fcgid
a2enmod fcgid
aptitude install php5-cgi php5-cli
<Directory /var/www>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options +ExecCGI
Alias /aptitude /usr/share/doc/aptitude/html/en
Alias /apt /usr/share/doc/apt-doc

<Directory /usr/share>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options ExecCGI FollowSymlinks Indexes

<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php5

With the above additions,  you can run apache2-mpm-worker or apt-get install apache2-mpm-prefork and either will run. Of course if you prefer to use the php apache module with apache2-mpm-prefork, you can add that with apt and remove the above script from conf.d


Categories: sysadmin