diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf index b84509e4..7daaeb75 100644 --- a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf @@ -32,7 +32,7 @@
Name of pool. Used in logs and stats. - default + www Address to accept fastcgi requests on. Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' @@ -50,6 +50,16 @@ Additional php.ini defines, specific to this pool of workers. + + 6135 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + Unix user of processes devilbox @@ -68,21 +78,25 @@ Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. - 50 + + 5 Settings group for 'apache-like' pm style Sets the number of server processes created on startup. Used only when 'apache-like' pm_style is selected - 4 + + 3 Sets the desired minimum number of idle server processes. Used only when 'apache-like' pm_style is selected + 2 Sets the desired maximum number of idle server processes. Used only when 'apache-like' pm_style is selected - 6 + + 4 @@ -97,7 +111,7 @@ 0s The log file for slow requests - logs/slow.log + /proc/self/fd/2 Set open file desc rlimit 1024 diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh b/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh index 587e2fb9..c4d119c4 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh @@ -33,6 +33,22 @@ copy_fpm_files() { run "find ${fpm_dst} -type f -iname '*.conf' -exec chmod 0644 \"{}\" \;" "${debug}" } +### +### Copy php-fpm.conf for PHP 5.2 +### Note: PHP 5.2 does not allow includes and comes in XML format, +### we must therefore copy the file to its main file /usr/local/etc/php-fpm.conf +### +copy_fpm_5_2_conf_file() { + local fpm_src="${1}" + local fpm_dst="/usr/local/etc/php-fpm.conf" + local debug="${2}" + + if [ -f "${fpm_src}" ]; then + log "info" "PHP-FPM.conf (PHP 5.2): php-fpm.xml -> ${fpm_dst}" "${debug}" + run "cp ${fpm_src} ${fpm_dst}" "${debug}" + fi +} + ############################################################ # Sanity Checks diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh b/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh index 2221e707..af877ec6 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# PHP FPM 5.3 does not allow to pass through environment variables +# PHP FPM 5.2 and PHP-FPM 5.3 do not allow to pass through environment variables # This is a hacky shell script to create: # env[NAME]='VALUE' entries for PHP FPM config out of all current env vars diff --git a/Dockerfiles/prod/data/docker-entrypoint.sh b/Dockerfiles/prod/data/docker-entrypoint.sh index 3a5a8fe2..970820d9 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.sh @@ -80,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### -### PHP-FPM 5.3 Env variables +### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix ### -if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then +if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf" fi @@ -159,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### ### Copy custom PHP-FPM *.conf files ### -copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +if [ "${PHP_VERSION}" = "5.2" ]; then + copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}" +else + copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +fi ### diff --git a/Dockerfiles/work/Dockerfile-5.2 b/Dockerfiles/work/Dockerfile-5.2 index b0b0f156..f79173c5 100644 --- a/Dockerfiles/work/Dockerfile-5.2 +++ b/Dockerfiles/work/Dockerfile-5.2 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 0fefc497..ab5614c0 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index 8d748be3..ef1f513d 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 3f99917a..8c3e7229 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index 03b72142..65e7a250 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 76c8bcb8..2b551868 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 9fbfccf2..11ee058c 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index 518e221b..6dbfee18 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index 7ea3bdd2..3be4e510 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ diff --git a/Dockerfiles/work/data/docker-entrypoint.sh b/Dockerfiles/work/data/docker-entrypoint.sh index b5248f36..afe08bd3 100755 --- a/Dockerfiles/work/data/docker-entrypoint.sh +++ b/Dockerfiles/work/data/docker-entrypoint.sh @@ -80,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### -### PHP-FPM 5.3 Env variables +### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix ### -if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then +if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf" fi @@ -159,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### ### Copy custom PHP-FPM *.conf files ### +if [ "${PHP_VERSION}" = "5.2" ]; then + copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}" +else copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +fi ### diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf index b84509e4..efd82405 100644 --- a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf @@ -32,7 +32,7 @@
Name of pool. Used in logs and stats. - default + www Address to accept fastcgi requests on. Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' @@ -50,6 +50,16 @@ Additional php.ini defines, specific to this pool of workers. + + -1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + Unix user of processes devilbox @@ -68,21 +78,25 @@ Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. - 50 + + 5 Settings group for 'apache-like' pm style Sets the number of server processes created on startup. Used only when 'apache-like' pm_style is selected - 4 + + 3 Sets the desired minimum number of idle server processes. Used only when 'apache-like' pm_style is selected + 2 Sets the desired maximum number of idle server processes. Used only when 'apache-like' pm_style is selected - 6 + + 4 @@ -97,7 +111,7 @@ 0s The log file for slow requests - logs/slow.log + /proc/self/fd/2 Set open file desc rlimit 1024 diff --git a/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 b/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 index 7bacedec..d4d297c6 100644 --- a/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 +++ b/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 @@ -160,7 +160,7 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al
Name of pool. Used in logs and stats. - default + www Address to accept fastcgi requests on. Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' @@ -178,6 +178,16 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al Additional php.ini defines, specific to this pool of workers. + + {% if item.key == 'base' %}6135{% else %}-1{% endif %} + 0 + 1 + {% if item.key == 'base' %}0{% else %}1{% endif %} + {% if item.key == 'base' %}0{% else %}1{% endif %} + 1 + 1 + {% if item.key == 'base' %}0{% else %}1{% endif %} + Unix user of processes {{ item.cfg[item.key].user | default(item.cfg[item.alt].user) }} @@ -196,21 +206,25 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. - {{ item.cfg[item.key].pm_max_children | default(item.cfg[item.alt].pm_max_children) }} + + 5 Settings group for 'apache-like' pm style Sets the number of server processes created on startup. Used only when 'apache-like' pm_style is selected - {{ item.cfg[item.key].pm_start_servers | default(item.cfg[item.alt].pm_start_servers) }} + + 3 Sets the desired minimum number of idle server processes. Used only when 'apache-like' pm_style is selected - {{ item.cfg[item.key].pm_min_spare_servers | default(item.cfg[item.alt].pm_min_spare_servers) }} + + 2 Sets the desired maximum number of idle server processes. Used only when 'apache-like' pm_style is selected - {{ item.cfg[item.key].pm_max_spare_servers | default(item.cfg[item.alt].pm_max_spare_servers) }} + + 4 @@ -225,7 +239,7 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al 0s The log file for slow requests - logs/slow.log + {{ item.cfg[item.key].error_log | default(item.cfg[item.alt].error_log) }} Set open file desc rlimit 1024 diff --git a/build/ansible/DOCKERFILES/Dockerfile-work.j2 b/build/ansible/DOCKERFILES/Dockerfile-work.j2 index 1ecc54ca..f76b64ff 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-work.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-work.j2 @@ -80,6 +80,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \