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

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

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
###00-fcgi###
<Directory /var/www>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options +ExecCGI
</Directory>
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
</Directory>

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

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
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: