├── LICENSE ├── README.md ├── apache ├── Dockerfile ├── apache.sh ├── conf-available │ └── servername.conf ├── mods-available_old │ └── fastcgi.conf └── sites-available │ ├── .gitignore │ ├── 000-default.conf │ └── 999-host.conf.default ├── docker-compose.yml ├── nginx ├── Dockerfile └── conf.d │ └── local.conf ├── php-cli ├── Dockerfile └── conf │ ├── 30-custom.ini │ └── www.conf └── php-fpm ├── Dockerfile └── conf ├── 30-custom.ini └── www.conf /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker-compose-apache-php_fpm 2 | Environement Docker Apache/Nginx + PHP-FPM + Mysql 3 | -------------------------------------------------------------------------------- /apache/Dockerfile: -------------------------------------------------------------------------------- 1 | # Serveur apache 2 | FROM debian:latest 3 | MAINTAINER Arnaud POINTET 4 | 5 | RUN echo 'deb http://ftp.fr.debian.org/debian/ jessie non-free' >> /etc/apt/sources.list 6 | RUN echo 'deb-src http://ftp.fr.debian.org/debian/ jessie non-free' >> /etc/apt/sources.list 7 | RUN apt-get update 8 | RUN apt-get -y install apache2 libapache2-mod-fastcgi 9 | 10 | RUN rm /etc/apache2/sites-enabled/* 11 | 12 | ENV VIRTUALHOST lab.dev 13 | 14 | ADD conf-available /etc/apache2/conf-available 15 | ADD sites-available /etc/apache2/sites-available 16 | #ADD mods-available /etc/apache2/mods-available 17 | 18 | EXPOSE 80 19 | 20 | ADD apache.sh /usr/bin/apache.sh 21 | RUN chmod +x /usr/bin/apache.sh 22 | ENTRYPOINT apache.sh 23 | 24 | VOLUME /var/www 25 | 26 | WORKDIR /var/www 27 | -------------------------------------------------------------------------------- /apache/apache.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | sed -i -e "s/\[VIRTUALHOST\]/$VIRTUALHOST/g" /etc/apache2/sites-available/999-host.conf 4 | 5 | a2enmod proxy 6 | a2enmod proxy_fcgi 7 | a2enconf servername 8 | a2ensite 000-default 9 | a2ensite 999-host 10 | 11 | /usr/sbin/apache2ctl -D FOREGROUND 12 | -------------------------------------------------------------------------------- /apache/conf-available/servername.conf: -------------------------------------------------------------------------------- 1 | ServerName localhost 2 | -------------------------------------------------------------------------------- /apache/mods-available_old/fastcgi.conf: -------------------------------------------------------------------------------- 1 | 2 | FastCGIExternalServer /usr/sbin/php5-fpm -host php:9000 3 | AddHandler php5-fastcgi .php 4 | 5 | Action php5-fastcgi /usr/sbin/php5-fpm.fcgi 6 | ScriptAlias /usr/sbin/php5-fpm.fcgi /usr/sbin/php5-fpm 7 | 8 | 9 | Options ExecCGI FollowSymLinks 10 | SetHandler fastcgi-script 11 | Order allow,deny 12 | Allow from all 13 | 14 | 15 | -------------------------------------------------------------------------------- /apache/sites-available/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | \!.gitignore 3 | \!000-default.conf 4 | \!999-host.conf.default 5 | -------------------------------------------------------------------------------- /apache/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /var/www 3 | ServerName default.dev 4 | 5 | 6 | Options Indexes FollowSymLinks 7 | AllowOverride All 8 | 9 | 10 | 11 | ProxyPass fcgi://php:9000/var/www/$1 12 | 13 | 14 | # Directory indexes 15 | 16 | DirectoryIndex index.html index.php 17 | 18 | 19 | ErrorLog ${APACHE_LOG_DIR}/error.log 20 | CustomLog ${APACHE_LOG_DIR}/access.log combined 21 | 22 | -------------------------------------------------------------------------------- /apache/sites-available/999-host.conf.default: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /var/www/[VIRTUALHOST] 3 | ServerName [VIRTUALHOST] 4 | 5 | 6 | Options Indexes FollowSymLinks 7 | AllowOverride All 8 | 9 | 10 | 11 | ProxyPass fcgi://php:9000/var/www/$1 12 | 13 | 14 | # Directory indexes 15 | 16 | DirectoryIndex index.html index.php 17 | 18 | 19 | ErrorLog ${APACHE_LOG_DIR}/error.log 20 | CustomLog ${APACHE_LOG_DIR}/access.log combined 21 | 22 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | apache: 2 | build: apache 3 | restart: always 4 | volumes: 5 | - /var/www:/var/www 6 | ports: 7 | - 90:80 8 | links: 9 | - php:php 10 | environment: 11 | - VIRTUALHOST=puzzle3d.dev 12 | 13 | 14 | nginx: 15 | build: nginx 16 | restart: always 17 | volumes: 18 | - /var/www:/var/www 19 | ports: 20 | - 80:80 21 | links: 22 | - php:php 23 | 24 | php: 25 | build: php-fpm 26 | restart: always 27 | volumes: 28 | - /var/www:/var/www 29 | ports: 30 | - 9000:9000 31 | links : 32 | - db:db 33 | 34 | db: 35 | image: mysql 36 | restart: always 37 | volumes: 38 | - /var/mysql:/var/mysql 39 | environment: 40 | - MYSQL_ROOT_PASSWORD=root 41 | 42 | dockerUi: 43 | image: dockerui/dockerui 44 | restart: always 45 | volumes: 46 | - /var/run/docker.sock:/var/run/docker.sock 47 | ports: 48 | - 5000:9000 49 | -------------------------------------------------------------------------------- /nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | # Serveur apache 2 | FROM nginx:latest 3 | MAINTAINER Arnaud POINTET 4 | 5 | ADD conf.d /etc/nginx/conf.d 6 | 7 | EXPOSE 80 8 | 9 | VOLUME /var/www 10 | 11 | RUN useradd arnaud -p arnaud 12 | 13 | WORKDIR /var/www 14 | -------------------------------------------------------------------------------- /nginx/conf.d/local.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | 4 | root /var/www; 5 | index index.php index.html index.htm; 6 | 7 | # Make site accessible from http://localhost/ 8 | server_name local.dev; 9 | 10 | location / { 11 | autoindex on; 12 | } 13 | 14 | location ~* \.PHP$ { 15 | fastcgi_index index.php; 16 | fastcgi_pass php:9000; 17 | include fastcgi_params; 18 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /php-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | # Serveur apache 2 | FROM php:5.6.11-cli 3 | MAINTAINER Arnaud POINTET 4 | 5 | RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ libmcrypt-dev 6 | RUN docker-php-ext-configure intl 7 | RUN docker-php-ext-install intl 8 | 9 | RUN apt-get update \ 10 | && docker-php-ext-install mbstring pdo_mysql mcrypt mysql 11 | 12 | ADD conf/www.conf /etc/php5/fpm/pool.d/www.conf 13 | ADD conf/30-custom.ini /usr/local/etc/php/conf.d/30-custom.ini 14 | 15 | ENTRYPOINT php-fpm --nodaemonize 16 | 17 | VOLUME /var/www 18 | 19 | WORKDIR /var/www 20 | -------------------------------------------------------------------------------- /php-cli/conf/30-custom.ini: -------------------------------------------------------------------------------- 1 | [Date] 2 | date.timezone = Europe/Paris 3 | -------------------------------------------------------------------------------- /php-cli/conf/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can we used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or /usr) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all IPv4 addresses on a 33 | ; specific port; 34 | ; '[::]:port' - to listen on a TCP socket to all addresses 35 | ; (IPv6 and IPv4-mapped) on a specific port; 36 | ; '/path/to/unix/socket' - to listen on a unix socket. 37 | ; Note: This value is mandatory. 38 | ;listen = /var/run/php5-fpm.sock 39 | listen = 127.0.0.1:9000 40 | 41 | ; Set listen(2) backlog. 42 | ; Default Value: 65535 (-1 on FreeBSD and OpenBSD) 43 | ;listen.backlog = 65535 44 | 45 | ; Set permissions for unix socket, if one is used. In Linux, read/write 46 | ; permissions must be set in order to allow connections from a web server. Many 47 | ; BSD-derived systems allow connections regardless of permissions. 48 | ; Default Values: user and group are set as the running user 49 | ; mode is set to 0660 50 | listen.owner = www-data 51 | listen.group = www-data 52 | listen.mode = 0660 53 | ; When POSIX Access Control Lists are supported you can set them using 54 | ; these options, value is a comma separated list of user/group names. 55 | ; When set, listen.owner and listen.group are ignored 56 | ;listen.acl_users = 57 | ;listen.acl_groups = 58 | 59 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 60 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 61 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 62 | ; must be separated by a comma. If this value is left blank, connections will be 63 | ; accepted from any ip address. 64 | ; Default Value: any 65 | ;listen.allowed_clients = 127.0.0.1 66 | 67 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 68 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 69 | ; Note: - It will only work if the FPM master process is launched as root 70 | ; - The pool processes will inherit the master process priority 71 | ; unless it specified otherwise 72 | ; Default Value: no set 73 | ; process.priority = -19 74 | 75 | ; Choose how the process manager will control the number of child processes. 76 | ; Possible Values: 77 | ; static - a fixed number (pm.max_children) of child processes; 78 | ; dynamic - the number of child processes are set dynamically based on the 79 | ; following directives. With this process management, there will be 80 | ; always at least 1 children. 81 | ; pm.max_children - the maximum number of children that can 82 | ; be alive at the same time. 83 | ; pm.start_servers - the number of children created on startup. 84 | ; pm.min_spare_servers - the minimum number of children in 'idle' 85 | ; state (waiting to process). If the number 86 | ; of 'idle' processes is less than this 87 | ; number then some children will be created. 88 | ; pm.max_spare_servers - the maximum number of children in 'idle' 89 | ; state (waiting to process). If the number 90 | ; of 'idle' processes is greater than this 91 | ; number then some children will be killed. 92 | ; ondemand - no children are created at startup. Children will be forked when 93 | ; new requests will connect. The following parameter are used: 94 | ; pm.max_children - the maximum number of children that 95 | ; can be alive at the same time. 96 | ; pm.process_idle_timeout - The number of seconds after which 97 | ; an idle process will be killed. 98 | ; Note: This value is mandatory. 99 | pm = dynamic 100 | 101 | ; The number of child processes to be created when pm is set to 'static' and the 102 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 103 | ; This value sets the limit on the number of simultaneous requests that will be 104 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 105 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 106 | ; CGI. The below defaults are based on a server without much resources. Don't 107 | ; forget to tweak pm.* to fit your needs. 108 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 109 | ; Note: This value is mandatory. 110 | pm.max_children = 5 111 | 112 | ; The number of child processes created on startup. 113 | ; Note: Used only when pm is set to 'dynamic' 114 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 115 | pm.start_servers = 2 116 | 117 | ; The desired minimum number of idle server processes. 118 | ; Note: Used only when pm is set to 'dynamic' 119 | ; Note: Mandatory when pm is set to 'dynamic' 120 | pm.min_spare_servers = 1 121 | 122 | ; The desired maximum number of idle server processes. 123 | ; Note: Used only when pm is set to 'dynamic' 124 | ; Note: Mandatory when pm is set to 'dynamic' 125 | pm.max_spare_servers = 3 126 | 127 | ; The number of seconds after which an idle process will be killed. 128 | ; Note: Used only when pm is set to 'ondemand' 129 | ; Default Value: 10s 130 | ;pm.process_idle_timeout = 10s; 131 | 132 | ; The number of requests each child process should execute before respawning. 133 | ; This can be useful to work around memory leaks in 3rd party libraries. For 134 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 135 | ; Default Value: 0 136 | ;pm.max_requests = 500 137 | 138 | ; The URI to view the FPM status page. If this value is not set, no URI will be 139 | ; recognized as a status page. It shows the following informations: 140 | ; pool - the name of the pool; 141 | ; process manager - static, dynamic or ondemand; 142 | ; start time - the date and time FPM has started; 143 | ; start since - number of seconds since FPM has started; 144 | ; accepted conn - the number of request accepted by the pool; 145 | ; listen queue - the number of request in the queue of pending 146 | ; connections (see backlog in listen(2)); 147 | ; max listen queue - the maximum number of requests in the queue 148 | ; of pending connections since FPM has started; 149 | ; listen queue len - the size of the socket queue of pending connections; 150 | ; idle processes - the number of idle processes; 151 | ; active processes - the number of active processes; 152 | ; total processes - the number of idle + active processes; 153 | ; max active processes - the maximum number of active processes since FPM 154 | ; has started; 155 | ; max children reached - number of times, the process limit has been reached, 156 | ; when pm tries to start more children (works only for 157 | ; pm 'dynamic' and 'ondemand'); 158 | ; Value are updated in real time. 159 | ; Example output: 160 | ; pool: www 161 | ; process manager: static 162 | ; start time: 01/Jul/2011:17:53:49 +0200 163 | ; start since: 62636 164 | ; accepted conn: 190460 165 | ; listen queue: 0 166 | ; max listen queue: 1 167 | ; listen queue len: 42 168 | ; idle processes: 4 169 | ; active processes: 11 170 | ; total processes: 15 171 | ; max active processes: 12 172 | ; max children reached: 0 173 | ; 174 | ; By default the status page output is formatted as text/plain. Passing either 175 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 176 | ; output syntax. Example: 177 | ; http://www.foo.bar/status 178 | ; http://www.foo.bar/status?json 179 | ; http://www.foo.bar/status?html 180 | ; http://www.foo.bar/status?xml 181 | ; 182 | ; By default the status page only outputs short status. Passing 'full' in the 183 | ; query string will also return status for each pool process. 184 | ; Example: 185 | ; http://www.foo.bar/status?full 186 | ; http://www.foo.bar/status?json&full 187 | ; http://www.foo.bar/status?html&full 188 | ; http://www.foo.bar/status?xml&full 189 | ; The Full status returns for each process: 190 | ; pid - the PID of the process; 191 | ; state - the state of the process (Idle, Running, ...); 192 | ; start time - the date and time the process has started; 193 | ; start since - the number of seconds since the process has started; 194 | ; requests - the number of requests the process has served; 195 | ; request duration - the duration in µs of the requests; 196 | ; request method - the request method (GET, POST, ...); 197 | ; request URI - the request URI with the query string; 198 | ; content length - the content length of the request (only with POST); 199 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 200 | ; script - the main script called (or '-' if not set); 201 | ; last request cpu - the %cpu the last request consumed 202 | ; it's always 0 if the process is not in Idle state 203 | ; because CPU calculation is done when the request 204 | ; processing has terminated; 205 | ; last request memory - the max amount of memory the last request consumed 206 | ; it's always 0 if the process is not in Idle state 207 | ; because memory calculation is done when the request 208 | ; processing has terminated; 209 | ; If the process is in Idle state, then informations are related to the 210 | ; last request the process has served. Otherwise informations are related to 211 | ; the current request being served. 212 | ; Example output: 213 | ; ************************ 214 | ; pid: 31330 215 | ; state: Running 216 | ; start time: 01/Jul/2011:17:53:49 +0200 217 | ; start since: 63087 218 | ; requests: 12808 219 | ; request duration: 1250261 220 | ; request method: GET 221 | ; request URI: /test_mem.php?N=10000 222 | ; content length: 0 223 | ; user: - 224 | ; script: /home/fat/web/docs/php/test_mem.php 225 | ; last request cpu: 0.00 226 | ; last request memory: 0 227 | ; 228 | ; Note: There is a real-time FPM status monitoring sample web page available 229 | ; It's available in: /usr/share/php5/fpm/status.html 230 | ; 231 | ; Note: The value must start with a leading slash (/). The value can be 232 | ; anything, but it may not be a good idea to use the .php extension or it 233 | ; may conflict with a real PHP file. 234 | ; Default Value: not set 235 | ;pm.status_path = /status 236 | 237 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 238 | ; URI will be recognized as a ping page. This could be used to test from outside 239 | ; that FPM is alive and responding, or to 240 | ; - create a graph of FPM availability (rrd or such); 241 | ; - remove a server from a group if it is not responding (load balancing); 242 | ; - trigger alerts for the operating team (24/7). 243 | ; Note: The value must start with a leading slash (/). The value can be 244 | ; anything, but it may not be a good idea to use the .php extension or it 245 | ; may conflict with a real PHP file. 246 | ; Default Value: not set 247 | ;ping.path = /ping 248 | 249 | ; This directive may be used to customize the response of a ping request. The 250 | ; response is formatted as text/plain with a 200 response code. 251 | ; Default Value: pong 252 | ;ping.response = pong 253 | 254 | ; The access log file 255 | ; Default: not set 256 | ;access.log = log/$pool.access.log 257 | 258 | ; The access log format. 259 | ; The following syntax is allowed 260 | ; %%: the '%' character 261 | ; %C: %CPU used by the request 262 | ; it can accept the following format: 263 | ; - %{user}C for user CPU only 264 | ; - %{system}C for system CPU only 265 | ; - %{total}C for user + system CPU (default) 266 | ; %d: time taken to serve the request 267 | ; it can accept the following format: 268 | ; - %{seconds}d (default) 269 | ; - %{miliseconds}d 270 | ; - %{mili}d 271 | ; - %{microseconds}d 272 | ; - %{micro}d 273 | ; %e: an environment variable (same as $_ENV or $_SERVER) 274 | ; it must be associated with embraces to specify the name of the env 275 | ; variable. Some exemples: 276 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 277 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 278 | ; %f: script filename 279 | ; %l: content-length of the request (for POST request only) 280 | ; %m: request method 281 | ; %M: peak of memory allocated by PHP 282 | ; it can accept the following format: 283 | ; - %{bytes}M (default) 284 | ; - %{kilobytes}M 285 | ; - %{kilo}M 286 | ; - %{megabytes}M 287 | ; - %{mega}M 288 | ; %n: pool name 289 | ; %o: output header 290 | ; it must be associated with embraces to specify the name of the header: 291 | ; - %{Content-Type}o 292 | ; - %{X-Powered-By}o 293 | ; - %{Transfert-Encoding}o 294 | ; - .... 295 | ; %p: PID of the child that serviced the request 296 | ; %P: PID of the parent of the child that serviced the request 297 | ; %q: the query string 298 | ; %Q: the '?' character if query string exists 299 | ; %r: the request URI (without the query string, see %q and %Q) 300 | ; %R: remote IP address 301 | ; %s: status (response code) 302 | ; %t: server time the request was received 303 | ; it can accept a strftime(3) format: 304 | ; %d/%b/%Y:%H:%M:%S %z (default) 305 | ; %T: time the log has been written (the request has finished) 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; %u: remote user 309 | ; 310 | ; Default: "%R - %u %t \"%m %r\" %s" 311 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 312 | 313 | ; The log file for slow requests 314 | ; Default Value: not set 315 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 316 | ;slowlog = log/$pool.log.slow 317 | 318 | ; The timeout for serving a single request after which a PHP backtrace will be 319 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 320 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 321 | ; Default Value: 0 322 | ;request_slowlog_timeout = 0 323 | 324 | ; The timeout for serving a single request after which the worker process will 325 | ; be killed. This option should be used when the 'max_execution_time' ini option 326 | ; does not stop script execution for some reason. A value of '0' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_terminate_timeout = 0 330 | 331 | ; Set open file descriptor rlimit. 332 | ; Default Value: system defined value 333 | ;rlimit_files = 1024 334 | 335 | ; Set max core size rlimit. 336 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 337 | ; Default Value: system defined value 338 | ;rlimit_core = 0 339 | 340 | ; Chroot to this directory at the start. This value must be defined as an 341 | ; absolute path. When this value is not set, chroot is not used. 342 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 343 | ; of its subdirectories. If the pool prefix is not set, the global prefix 344 | ; will be used instead. 345 | ; Note: chrooting is a great security feature and should be used whenever 346 | ; possible. However, all PHP paths will be relative to the chroot 347 | ; (error_log, sessions.save_path, ...). 348 | ; Default Value: not set 349 | ;chroot = 350 | 351 | ; Chdir to this directory at the start. 352 | ; Note: relative path can be used. 353 | ; Default Value: current directory or / when chroot 354 | chdir = / 355 | 356 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 357 | ; stderr will be redirected to /dev/null according to FastCGI specs. 358 | ; Note: on highloaded environement, this can cause some delay in the page 359 | ; process time (several ms). 360 | ; Default Value: no 361 | ;catch_workers_output = yes 362 | 363 | ; Clear environment in FPM workers 364 | ; Prevents arbitrary environment variables from reaching FPM worker processes 365 | ; by clearing the environment in workers before env vars specified in this 366 | ; pool configuration are added. 367 | ; Setting to "no" will make all environment variables available to PHP code 368 | ; via getenv(), $_ENV and $_SERVER. 369 | ; Default Value: yes 370 | ;clear_env = no 371 | 372 | ; Limits the extensions of the main script FPM will allow to parse. This can 373 | ; prevent configuration mistakes on the web server side. You should only limit 374 | ; FPM to .php extensions to prevent malicious users to use other extensions to 375 | ; exectute php code. 376 | ; Note: set an empty value to allow all extensions. 377 | ; Default Value: .php 378 | ;security.limit_extensions = .php .php3 .php4 .php5 379 | 380 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 381 | ; the current environment. 382 | ; Default Value: clean env 383 | ;env[HOSTNAME] = $HOSTNAME 384 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 385 | ;env[TMP] = /tmp 386 | ;env[TMPDIR] = /tmp 387 | ;env[TEMP] = /tmp 388 | 389 | ; Additional php.ini defines, specific to this pool of workers. These settings 390 | ; overwrite the values previously defined in the php.ini. The directives are the 391 | ; same as the PHP SAPI: 392 | ; php_value/php_flag - you can set classic ini defines which can 393 | ; be overwritten from PHP call 'ini_set'. 394 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 395 | ; PHP call 'ini_set' 396 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 397 | 398 | ; Defining 'extension' will load the corresponding shared extension from 399 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 400 | ; overwrite previously defined php.ini values, but will append the new value 401 | ; instead. 402 | 403 | ; Note: path INI options can be relative and will be expanded with the prefix 404 | ; (pool, global or /usr) 405 | 406 | ; Default Value: nothing is defined by default except the values in php.ini and 407 | ; specified at startup with the -d argument 408 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 409 | ;php_flag[display_errors] = off 410 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 411 | ;php_admin_flag[log_errors] = on 412 | ;php_admin_value[memory_limit] = 32M 413 | -------------------------------------------------------------------------------- /php-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # Serveur apache 2 | FROM php:5.6.11-fpm 3 | MAINTAINER Arnaud POINTET 4 | 5 | RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ libmcrypt-dev 6 | RUN docker-php-ext-configure intl 7 | RUN docker-php-ext-install intl 8 | 9 | RUN curl https://pecl.php.net/get/mongo-1.5.8.tgz > /tmp/mongo.tgz 10 | RUN tar -xpzf /tmp/mongo.tgz 11 | RUN mv mongo-1.5.8 /usr/src/php/ext 12 | RUN docker-php-ext-install mongo-1.5.8 13 | 14 | RUN apt-get update \ 15 | && docker-php-ext-install mbstring pdo_mysql mcrypt mysql 16 | 17 | ADD conf/www.conf /etc/php5/fpm/pool.d/www.conf 18 | ADD conf/30-custom.ini /usr/local/etc/php/conf.d/30-custom.ini 19 | 20 | RUN useradd arnaud -p arnaud 21 | 22 | RUN apt-get update 23 | RUN apt-get -y install wget 24 | 25 | RUN wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb 26 | RUN apt-get -y install xfonts-base xfonts-75dpi xfonts-utils fontconfig libxext6 libfontconfig1 libjpeg62-turbo libx11-6 libxrender1 27 | RUN dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb 28 | RUN rm wkhtmltox-0.12.2.1_linux-jessie-amd64.deb 29 | 30 | RUN apt-get -y install locales 31 | # Set the locale 32 | RUN locale-gen fr_FR.utf8 33 | ENV LANG fr_FR.utf8 34 | ENV LANGUAGE fr_FR:fr 35 | ENV LC_ALL fr_FR.utf8 36 | 37 | ENTRYPOINT php-fpm --nodaemonize 38 | 39 | VOLUME /var/www 40 | 41 | WORKDIR /var/www 42 | -------------------------------------------------------------------------------- /php-fpm/conf/30-custom.ini: -------------------------------------------------------------------------------- 1 | [Date] 2 | date.timezone = Europe/Paris 3 | -------------------------------------------------------------------------------- /php-fpm/conf/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can we used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or /usr) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all IPv4 addresses on a 33 | ; specific port; 34 | ; '[::]:port' - to listen on a TCP socket to all addresses 35 | ; (IPv6 and IPv4-mapped) on a specific port; 36 | ; '/path/to/unix/socket' - to listen on a unix socket. 37 | ; Note: This value is mandatory. 38 | ;listen = /var/run/php5-fpm.sock 39 | listen = 127.0.0.1:9000 40 | 41 | ; Set listen(2) backlog. 42 | ; Default Value: 65535 (-1 on FreeBSD and OpenBSD) 43 | ;listen.backlog = 65535 44 | 45 | ; Set permissions for unix socket, if one is used. In Linux, read/write 46 | ; permissions must be set in order to allow connections from a web server. Many 47 | ; BSD-derived systems allow connections regardless of permissions. 48 | ; Default Values: user and group are set as the running user 49 | ; mode is set to 0660 50 | listen.owner = www-data 51 | listen.group = www-data 52 | listen.mode = 0660 53 | ; When POSIX Access Control Lists are supported you can set them using 54 | ; these options, value is a comma separated list of user/group names. 55 | ; When set, listen.owner and listen.group are ignored 56 | ;listen.acl_users = 57 | ;listen.acl_groups = 58 | 59 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 60 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 61 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 62 | ; must be separated by a comma. If this value is left blank, connections will be 63 | ; accepted from any ip address. 64 | ; Default Value: any 65 | ;listen.allowed_clients = 127.0.0.1 66 | 67 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 68 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 69 | ; Note: - It will only work if the FPM master process is launched as root 70 | ; - The pool processes will inherit the master process priority 71 | ; unless it specified otherwise 72 | ; Default Value: no set 73 | ; process.priority = -19 74 | 75 | ; Choose how the process manager will control the number of child processes. 76 | ; Possible Values: 77 | ; static - a fixed number (pm.max_children) of child processes; 78 | ; dynamic - the number of child processes are set dynamically based on the 79 | ; following directives. With this process management, there will be 80 | ; always at least 1 children. 81 | ; pm.max_children - the maximum number of children that can 82 | ; be alive at the same time. 83 | ; pm.start_servers - the number of children created on startup. 84 | ; pm.min_spare_servers - the minimum number of children in 'idle' 85 | ; state (waiting to process). If the number 86 | ; of 'idle' processes is less than this 87 | ; number then some children will be created. 88 | ; pm.max_spare_servers - the maximum number of children in 'idle' 89 | ; state (waiting to process). If the number 90 | ; of 'idle' processes is greater than this 91 | ; number then some children will be killed. 92 | ; ondemand - no children are created at startup. Children will be forked when 93 | ; new requests will connect. The following parameter are used: 94 | ; pm.max_children - the maximum number of children that 95 | ; can be alive at the same time. 96 | ; pm.process_idle_timeout - The number of seconds after which 97 | ; an idle process will be killed. 98 | ; Note: This value is mandatory. 99 | pm = dynamic 100 | 101 | ; The number of child processes to be created when pm is set to 'static' and the 102 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 103 | ; This value sets the limit on the number of simultaneous requests that will be 104 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 105 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 106 | ; CGI. The below defaults are based on a server without much resources. Don't 107 | ; forget to tweak pm.* to fit your needs. 108 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 109 | ; Note: This value is mandatory. 110 | pm.max_children = 5 111 | 112 | ; The number of child processes created on startup. 113 | ; Note: Used only when pm is set to 'dynamic' 114 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 115 | pm.start_servers = 2 116 | 117 | ; The desired minimum number of idle server processes. 118 | ; Note: Used only when pm is set to 'dynamic' 119 | ; Note: Mandatory when pm is set to 'dynamic' 120 | pm.min_spare_servers = 1 121 | 122 | ; The desired maximum number of idle server processes. 123 | ; Note: Used only when pm is set to 'dynamic' 124 | ; Note: Mandatory when pm is set to 'dynamic' 125 | pm.max_spare_servers = 3 126 | 127 | ; The number of seconds after which an idle process will be killed. 128 | ; Note: Used only when pm is set to 'ondemand' 129 | ; Default Value: 10s 130 | ;pm.process_idle_timeout = 10s; 131 | 132 | ; The number of requests each child process should execute before respawning. 133 | ; This can be useful to work around memory leaks in 3rd party libraries. For 134 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 135 | ; Default Value: 0 136 | ;pm.max_requests = 500 137 | 138 | ; The URI to view the FPM status page. If this value is not set, no URI will be 139 | ; recognized as a status page. It shows the following informations: 140 | ; pool - the name of the pool; 141 | ; process manager - static, dynamic or ondemand; 142 | ; start time - the date and time FPM has started; 143 | ; start since - number of seconds since FPM has started; 144 | ; accepted conn - the number of request accepted by the pool; 145 | ; listen queue - the number of request in the queue of pending 146 | ; connections (see backlog in listen(2)); 147 | ; max listen queue - the maximum number of requests in the queue 148 | ; of pending connections since FPM has started; 149 | ; listen queue len - the size of the socket queue of pending connections; 150 | ; idle processes - the number of idle processes; 151 | ; active processes - the number of active processes; 152 | ; total processes - the number of idle + active processes; 153 | ; max active processes - the maximum number of active processes since FPM 154 | ; has started; 155 | ; max children reached - number of times, the process limit has been reached, 156 | ; when pm tries to start more children (works only for 157 | ; pm 'dynamic' and 'ondemand'); 158 | ; Value are updated in real time. 159 | ; Example output: 160 | ; pool: www 161 | ; process manager: static 162 | ; start time: 01/Jul/2011:17:53:49 +0200 163 | ; start since: 62636 164 | ; accepted conn: 190460 165 | ; listen queue: 0 166 | ; max listen queue: 1 167 | ; listen queue len: 42 168 | ; idle processes: 4 169 | ; active processes: 11 170 | ; total processes: 15 171 | ; max active processes: 12 172 | ; max children reached: 0 173 | ; 174 | ; By default the status page output is formatted as text/plain. Passing either 175 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 176 | ; output syntax. Example: 177 | ; http://www.foo.bar/status 178 | ; http://www.foo.bar/status?json 179 | ; http://www.foo.bar/status?html 180 | ; http://www.foo.bar/status?xml 181 | ; 182 | ; By default the status page only outputs short status. Passing 'full' in the 183 | ; query string will also return status for each pool process. 184 | ; Example: 185 | ; http://www.foo.bar/status?full 186 | ; http://www.foo.bar/status?json&full 187 | ; http://www.foo.bar/status?html&full 188 | ; http://www.foo.bar/status?xml&full 189 | ; The Full status returns for each process: 190 | ; pid - the PID of the process; 191 | ; state - the state of the process (Idle, Running, ...); 192 | ; start time - the date and time the process has started; 193 | ; start since - the number of seconds since the process has started; 194 | ; requests - the number of requests the process has served; 195 | ; request duration - the duration in µs of the requests; 196 | ; request method - the request method (GET, POST, ...); 197 | ; request URI - the request URI with the query string; 198 | ; content length - the content length of the request (only with POST); 199 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 200 | ; script - the main script called (or '-' if not set); 201 | ; last request cpu - the %cpu the last request consumed 202 | ; it's always 0 if the process is not in Idle state 203 | ; because CPU calculation is done when the request 204 | ; processing has terminated; 205 | ; last request memory - the max amount of memory the last request consumed 206 | ; it's always 0 if the process is not in Idle state 207 | ; because memory calculation is done when the request 208 | ; processing has terminated; 209 | ; If the process is in Idle state, then informations are related to the 210 | ; last request the process has served. Otherwise informations are related to 211 | ; the current request being served. 212 | ; Example output: 213 | ; ************************ 214 | ; pid: 31330 215 | ; state: Running 216 | ; start time: 01/Jul/2011:17:53:49 +0200 217 | ; start since: 63087 218 | ; requests: 12808 219 | ; request duration: 1250261 220 | ; request method: GET 221 | ; request URI: /test_mem.php?N=10000 222 | ; content length: 0 223 | ; user: - 224 | ; script: /home/fat/web/docs/php/test_mem.php 225 | ; last request cpu: 0.00 226 | ; last request memory: 0 227 | ; 228 | ; Note: There is a real-time FPM status monitoring sample web page available 229 | ; It's available in: /usr/share/php5/fpm/status.html 230 | ; 231 | ; Note: The value must start with a leading slash (/). The value can be 232 | ; anything, but it may not be a good idea to use the .php extension or it 233 | ; may conflict with a real PHP file. 234 | ; Default Value: not set 235 | ;pm.status_path = /status 236 | 237 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 238 | ; URI will be recognized as a ping page. This could be used to test from outside 239 | ; that FPM is alive and responding, or to 240 | ; - create a graph of FPM availability (rrd or such); 241 | ; - remove a server from a group if it is not responding (load balancing); 242 | ; - trigger alerts for the operating team (24/7). 243 | ; Note: The value must start with a leading slash (/). The value can be 244 | ; anything, but it may not be a good idea to use the .php extension or it 245 | ; may conflict with a real PHP file. 246 | ; Default Value: not set 247 | ;ping.path = /ping 248 | 249 | ; This directive may be used to customize the response of a ping request. The 250 | ; response is formatted as text/plain with a 200 response code. 251 | ; Default Value: pong 252 | ;ping.response = pong 253 | 254 | ; The access log file 255 | ; Default: not set 256 | ;access.log = log/$pool.access.log 257 | 258 | ; The access log format. 259 | ; The following syntax is allowed 260 | ; %%: the '%' character 261 | ; %C: %CPU used by the request 262 | ; it can accept the following format: 263 | ; - %{user}C for user CPU only 264 | ; - %{system}C for system CPU only 265 | ; - %{total}C for user + system CPU (default) 266 | ; %d: time taken to serve the request 267 | ; it can accept the following format: 268 | ; - %{seconds}d (default) 269 | ; - %{miliseconds}d 270 | ; - %{mili}d 271 | ; - %{microseconds}d 272 | ; - %{micro}d 273 | ; %e: an environment variable (same as $_ENV or $_SERVER) 274 | ; it must be associated with embraces to specify the name of the env 275 | ; variable. Some exemples: 276 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 277 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 278 | ; %f: script filename 279 | ; %l: content-length of the request (for POST request only) 280 | ; %m: request method 281 | ; %M: peak of memory allocated by PHP 282 | ; it can accept the following format: 283 | ; - %{bytes}M (default) 284 | ; - %{kilobytes}M 285 | ; - %{kilo}M 286 | ; - %{megabytes}M 287 | ; - %{mega}M 288 | ; %n: pool name 289 | ; %o: output header 290 | ; it must be associated with embraces to specify the name of the header: 291 | ; - %{Content-Type}o 292 | ; - %{X-Powered-By}o 293 | ; - %{Transfert-Encoding}o 294 | ; - .... 295 | ; %p: PID of the child that serviced the request 296 | ; %P: PID of the parent of the child that serviced the request 297 | ; %q: the query string 298 | ; %Q: the '?' character if query string exists 299 | ; %r: the request URI (without the query string, see %q and %Q) 300 | ; %R: remote IP address 301 | ; %s: status (response code) 302 | ; %t: server time the request was received 303 | ; it can accept a strftime(3) format: 304 | ; %d/%b/%Y:%H:%M:%S %z (default) 305 | ; %T: time the log has been written (the request has finished) 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; %u: remote user 309 | ; 310 | ; Default: "%R - %u %t \"%m %r\" %s" 311 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 312 | 313 | ; The log file for slow requests 314 | ; Default Value: not set 315 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 316 | ;slowlog = log/$pool.log.slow 317 | 318 | ; The timeout for serving a single request after which a PHP backtrace will be 319 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 320 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 321 | ; Default Value: 0 322 | ;request_slowlog_timeout = 0 323 | 324 | ; The timeout for serving a single request after which the worker process will 325 | ; be killed. This option should be used when the 'max_execution_time' ini option 326 | ; does not stop script execution for some reason. A value of '0' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_terminate_timeout = 0 330 | 331 | ; Set open file descriptor rlimit. 332 | ; Default Value: system defined value 333 | ;rlimit_files = 1024 334 | 335 | ; Set max core size rlimit. 336 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 337 | ; Default Value: system defined value 338 | ;rlimit_core = 0 339 | 340 | ; Chroot to this directory at the start. This value must be defined as an 341 | ; absolute path. When this value is not set, chroot is not used. 342 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 343 | ; of its subdirectories. If the pool prefix is not set, the global prefix 344 | ; will be used instead. 345 | ; Note: chrooting is a great security feature and should be used whenever 346 | ; possible. However, all PHP paths will be relative to the chroot 347 | ; (error_log, sessions.save_path, ...). 348 | ; Default Value: not set 349 | ;chroot = 350 | 351 | ; Chdir to this directory at the start. 352 | ; Note: relative path can be used. 353 | ; Default Value: current directory or / when chroot 354 | chdir = / 355 | 356 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 357 | ; stderr will be redirected to /dev/null according to FastCGI specs. 358 | ; Note: on highloaded environement, this can cause some delay in the page 359 | ; process time (several ms). 360 | ; Default Value: no 361 | ;catch_workers_output = yes 362 | 363 | ; Clear environment in FPM workers 364 | ; Prevents arbitrary environment variables from reaching FPM worker processes 365 | ; by clearing the environment in workers before env vars specified in this 366 | ; pool configuration are added. 367 | ; Setting to "no" will make all environment variables available to PHP code 368 | ; via getenv(), $_ENV and $_SERVER. 369 | ; Default Value: yes 370 | ;clear_env = no 371 | 372 | ; Limits the extensions of the main script FPM will allow to parse. This can 373 | ; prevent configuration mistakes on the web server side. You should only limit 374 | ; FPM to .php extensions to prevent malicious users to use other extensions to 375 | ; exectute php code. 376 | ; Note: set an empty value to allow all extensions. 377 | ; Default Value: .php 378 | ;security.limit_extensions = .php .php3 .php4 .php5 379 | 380 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 381 | ; the current environment. 382 | ; Default Value: clean env 383 | ;env[HOSTNAME] = $HOSTNAME 384 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 385 | ;env[TMP] = /tmp 386 | ;env[TMPDIR] = /tmp 387 | ;env[TEMP] = /tmp 388 | 389 | ; Additional php.ini defines, specific to this pool of workers. These settings 390 | ; overwrite the values previously defined in the php.ini. The directives are the 391 | ; same as the PHP SAPI: 392 | ; php_value/php_flag - you can set classic ini defines which can 393 | ; be overwritten from PHP call 'ini_set'. 394 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 395 | ; PHP call 'ini_set' 396 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 397 | 398 | ; Defining 'extension' will load the corresponding shared extension from 399 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 400 | ; overwrite previously defined php.ini values, but will append the new value 401 | ; instead. 402 | 403 | ; Note: path INI options can be relative and will be expanded with the prefix 404 | ; (pool, global or /usr) 405 | 406 | ; Default Value: nothing is defined by default except the values in php.ini and 407 | ; specified at startup with the -d argument 408 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 409 | ;php_flag[display_errors] = off 410 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 411 | ;php_admin_flag[log_errors] = on 412 | ;php_admin_value[memory_limit] = 32M 413 | --------------------------------------------------------------------------------