sda.io

Mike Sampson

Linux Systems Administrator

About

Archives

Feed

30 Mar 2011

Nginx

Recently replaced lighttpd with nginx on Debian squeeze. Used spawn-fcgi to manage PHP as php-fpm is not in squeeze yet. Had a little trouble with reliability until I set a couple of environment variables before spawning the PHP processes. Since using the script below to start php all has been well.

#!/bin/bash
PHP_FCGI_CHILDREN=2 \
PHP_FCGI_MAX_REQUESTS=1000 \
/usr/bin/spawn-fcgi -s /tmp/cgi-php.socket -u www-data -g www-data \
                    -P /var/run/cgi-php.pid \
                    -- /usr/bin/php5-cgi

Next I would like to look at setting up varnish in front of nginx.

Copyright © 2018 - Mike Sampson - Powered by cobalt.rs & Skeleton