Commit 0fc93e20 authored by Floris Bos's avatar Floris Bos Committed by Thomas Petazzoni
Browse files

php: fpm sapi: install php-fpm.conf



Install a custom php-fpm.conf instead of the stock one.

- Listening on /var/run/php-fpm.sock instead of TCP port so we can
  restrict access to webserver user www-data.
- Using ondemand pm, so PHP children are only started after a PHP
  request, instead of kept resident all the time.

Signed-off-by: default avatarFloris Bos <bos@je-eigen-domein.nl>
Reviewed-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 8eeb1457
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
[www]
# Only start children when there are requests to be processed
pm = ondemand
# Terminate them again after there haven't been any for 2 minutes
pm.process_idle_timeout = 120s
# Maximum number of children processing PHP requests concurrently
pm.max_children = 5

listen = /var/run/php-fpm.sock
listen.owner = www-data
listen.group = www-data
user = www-data
group = www-data
+8 −0
Original line number Diff line number Diff line
@@ -264,6 +264,14 @@ define PHP_INSTALL_INIT_SYSTEMD
	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
endef

define PHP_INSTALL_FPM_CONF
	$(INSTALL) -D -m 0644 package/php/php-fpm.conf \
		$(TARGET_DIR)/etc/php-fpm.conf
	rm -f $(TARGET_DIR)/etc/php-fpm.conf.default
endef

PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF
endif

define PHP_EXTENSIONS_FIXUP