squirrelmail on PHP-FPM + nginx

環境:Debian 7.1 AMD64
準備:あらかじめapache2 + mod_phpでsquirrelmailの動作を確認
参考:
Ubuntu で Web メールサーバー
http://www.upken.jp/kb/ubuntu-squirrelmail.html
Running SquirrelMail On Nginx (LEMP) On Debian Squeeze/Ubuntu 11.04
http://www.howtoforge.com/running-squirrelmail-on-nginx-lemp-on-debian-squeeze-ubuntu-11.04
PHP-FPMのインストール
> sudo aptitude install php5-fpm php5-common
設定は /etc/php5/fpm/ 以下
/etc/php5/fpm/php-fpm.conf を見てみると次の一行が
include=/etc/php5/fpm/pool.d/*.conf
ということで apache2 等と同じように /pool.d/ 以下に設定ファイルを置くのが常道らしい。
次のようにportを設定
> sudo vi /etc/php5/fpm/pool.d/www.conf
#listen = /var/run/php5-fpm.sock :コメントアウト
listen = 127.0.0.1:9000
> sudo service php5-fpm start
次で確認
> netstat -an | grep 9000
nginxの設定
> sudo vi /etc/nginx/sites-available/default
次を追記

# PHP-FPM for squirrelmail
location /squirrelmail {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/squirrelmail/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}

> sudo service nginx restart