Experimental: Aegir 2 on Ubuntu 12.04 with apache, php-fpm
These notes describe a possible way of installing Apache with fastcgi using php5-fpm. The below configuration works but is experimental.
On a Ubuntu 12.04 box:
Install Aegir2 from Debian packages
Follow http://community.aegirproject.org/node/400. Below is a shortened form.
Add the Aegir package "Software Source" repository:
echo "deb http://debian.aegirproject.org stable main" | sudo tee -a /etc/apt/sources.list.d/aegir-stable.list
wget -q http://debian.aegirproject.org/key.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo apt-get install aegir2
Verify your aegir site works
Navigate your browser to the FQDN of your aegir server. You need to see the "Welcome to Aegir" page.
Modify the configuration to use fastcgi / php5-fpm
sudo apt-get install php5-fpm libapache2-mod-fastcgi
sudo apt-get --purge remove libapache2-mod-php5
Modify /etc/php5/fpm/pool.d/www.conf Make it listen on socket, instead of IP:
;listen = 127.0.0.1:9000
listen = /var/run/php-fpm.sock
create /etc/apache2/conf.d/php-fpm.conf
ScriptAlias /php5.fastcgi /var/www/fastcgi
FastCGIExternalServer /var/www/fastcgi -socket /run/php-fpm.sock
AddHandler php-fastcgi .php
Action php-fastcgi /php5.fastcgi virtual
Options FollowSymLinks ExecCGI
<Directory /var/www/fastcgi>
Options ExecCGI FollowSymLinks
SetHandler fastcgi-script
Order allow,deny
Allow from all
</Directory>
Enable apache modules:
sudo a2enmod actions alias fastcgi
Restart php5-fpm and apache to load the new configs:
sudo service php5-fpm restart
sudo service apache2 restart
Verify you can still reach your Aegir site
Navigate your browser to the FQDN of your aegir server. This time, you are using php5-fpm. Verify e.g. via phpifno().
--
Page author: Marji Cermak marji@morpht.com, http://morpht.com