back

INI with sections, reference and includes

INI with a sections for each pool + template system + includes

/etc/fpm.conf

	;
	; Global
	;
	pid = /var/run/fpm.pid
	daemonize = yes
	error_log = /var/log/fpm/errors.log
	log_level = notice
	emergency_restart_threshold = 10
	emergency_restart_interval = 1m
	process_control_timeout = 5s

	;
	; default pool, which is not a real one
	; is a template to be used by real pools
	;
	[default]
	is_a_reference = yes

	group = www

	pm = dynamic
	pm.max_children = 42
	pm.start_servers = 5
	pm.min_spare_servers = 3
	pm.max_spare_servers = 10
	pm.max_requests = 500
	pm.status_path = /status

	listen.backlog = -1
	listen.socket_owner = _nginx
	listen.socket_groupe = _nginx
	listen.socket_mode = 0600

	ping.path = /ping
	ping.response = pong

	request_terminate_timeout = 0
	request_slowlog_timeout = 0

	rlimit_files = 1024
	rlimit_core = 0
	chroot = no
	catch_workers_output = yes
	allowed_client[] = 127.0.0.1

	php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i
	php_flag[display_errors] = yes

	env[PATH] = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

	;
	; pools here !
	;
	include = /etc/fpm/*.conf

/etc/fpm/www.conf

	;
	; www pool
	;
	[www]
	reference = default
	user = www_www

	listen = 127.0.0.1:9000

	slowlog = /home/www_www/logs/fpm.slow.log
	chdir = /home/www_www/docs

	php_admin_value[error_log] = /home/www_www/logs/php.log
	php_admin_value[open_basedir] = /home/www_www/docs:/home/www_www/sessions:/home/www_www/tmp
	php_admin_value[session.save_path] = /home/www_www/sessions
	php_admin_value[upload_tmp_dir] = /home/www_www/tmp

/etc/fpm/backoffice.conf

	;
	; backoffice pool here
	;
	[backoffice]
	reference = default
	user = www_backoffice

	listen = 127.0.0.1:9001

	slowlog = /home/www_backoffice/logs/fpm.slow.log
	chdir = /home/www_backoffice/docs

	php_admin_value[error_log] = /home/www_backoffice/logs/php.log
	php_admin_value[open_basedir] = /home/www_backoffice/docs:/home/www_backoffice/sessions:/home/www_backoffice/tmp
	php_admin_value[session.save_path] = /home/www_backoffice/sessions
	php_admin_value[upload_tmp_dir] = /home/www_backoffice/tmp

/etc/fpm/www.another.site.com.conf

	;
	; www.another.site.com pool here
	; this one is chrooted with a static process manager
	;
	[www.another.site.com]
	reference = default
	user = www_www.another.site.com

	pm = static
	pm.max_children = 42
	listen = 127.0.0.1:9002

	slowlog = /logs/fpm.slow.log
	chroot = /home/www.another.site.com
	chdir = /docs

	php_admin_value[sendmail_path] = /bin/mini_sendmail -t -i
	php_admin_value[error_log] = /logs/php.log
	php_admin_value[open_basedir] = /docs:/sessions:/tmp
	php_admin_value[session.save_path] = /sessions
	php_admin_value[upload_tmp_dir] = /tmp

	env[PATH] = /bin