Newer Older
413 lines | 18.362kb
initial commit
admin cloud-section (root) authored on 2016-12-10
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
[cloud]
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-$pool.sock
39

            
40
; Set listen(2) backlog.
41
; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
42
;listen.backlog = 65535
43

            
44
; Set permissions for unix socket, if one is used. In Linux, read/write
45
; permissions must be set in order to allow connections from a web server. Many
46
; BSD-derived systems allow connections regardless of permissions. 
47
; Default Values: user and group are set as the running user
48
;                 mode is set to 0660
49
listen.owner = www-data
50
listen.group = www-data
51
;listen.mode = 0660
52
; When POSIX Access Control Lists are supported you can set them using
53
; these options, value is a comma separated list of user/group names.
54
; When set, listen.owner and listen.group are ignored
55
;listen.acl_users =
56
;listen.acl_groups =
57
 
58
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
59
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
60
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
61
; must be separated by a comma. If this value is left blank, connections will be
62
; accepted from any ip address.
63
; Default Value: any
64
;listen.allowed_clients = 127.0.0.1
65

            
66
; Specify the nice(2) priority to apply to the pool processes (only if set)
67
; The value can vary from -19 (highest priority) to 20 (lower priority)
68
; Note: - It will only work if the FPM master process is launched as root
69
;       - The pool processes will inherit the master process priority
70
;         unless it specified otherwise
71
; Default Value: no set
72
; process.priority = -19
73

            
74
; Choose how the process manager will control the number of child processes.
75
; Possible Values:
76
;   static  - a fixed number (pm.max_children) of child processes;
77
;   dynamic - the number of child processes are set dynamically based on the
78
;             following directives. With this process management, there will be
79
;             always at least 1 children.
80
;             pm.max_children      - the maximum number of children that can
81
;                                    be alive at the same time.
82
;             pm.start_servers     - the number of children created on startup.
83
;             pm.min_spare_servers - the minimum number of children in 'idle'
84
;                                    state (waiting to process). If the number
85
;                                    of 'idle' processes is less than this
86
;                                    number then some children will be created.
87
;             pm.max_spare_servers - the maximum number of children in 'idle'
88
;                                    state (waiting to process). If the number
89
;                                    of 'idle' processes is greater than this
90
;                                    number then some children will be killed.
91
;  ondemand - no children are created at startup. Children will be forked when
92
;             new requests will connect. The following parameter are used:
93
;             pm.max_children           - the maximum number of children that
94
;                                         can be alive at the same time.
95
;             pm.process_idle_timeout   - The number of seconds after which
96
;                                         an idle process will be killed.
97
; Note: This value is mandatory.
98
pm = dynamic
99

            
100
; The number of child processes to be created when pm is set to 'static' and the
101
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
102
; This value sets the limit on the number of simultaneous requests that will be
103
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
104
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
105
; CGI. The below defaults are based on a server without much resources. Don't
106
; forget to tweak pm.* to fit your needs.
107
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
108
; Note: This value is mandatory.
109
pm.max_children = 15
110

            
111
; The number of child processes created on startup.
112
; Note: Used only when pm is set to 'dynamic'
113
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
114
pm.start_servers = 2
115

            
116
; The desired minimum number of idle server processes.
117
; Note: Used only when pm is set to 'dynamic'
118
; Note: Mandatory when pm is set to 'dynamic'
119
pm.min_spare_servers = 1
120

            
121
; The desired maximum number of idle server processes.
122
; Note: Used only when pm is set to 'dynamic'
123
; Note: Mandatory when pm is set to 'dynamic'
124
pm.max_spare_servers = 3
125

            
126
; The number of seconds after which an idle process will be killed.
127
; Note: Used only when pm is set to 'ondemand'
128
; Default Value: 10s
129
;pm.process_idle_timeout = 10s;
130
 
131
; The number of requests each child process should execute before respawning.
132
; This can be useful to work around memory leaks in 3rd party libraries. For
133
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
134
; Default Value: 0
135
;pm.max_requests = 500
136

            
137
; The URI to view the FPM status page. If this value is not set, no URI will be
138
; recognized as a status page. It shows the following informations:
139
;   pool                 - the name of the pool;
140
;   process manager      - static, dynamic or ondemand;
141
;   start time           - the date and time FPM has started;
142
;   start since          - number of seconds since FPM has started;
143
;   accepted conn        - the number of request accepted by the pool;
144
;   listen queue         - the number of request in the queue of pending
145
;                          connections (see backlog in listen(2));
146
;   max listen queue     - the maximum number of requests in the queue
147
;                          of pending connections since FPM has started;
148
;   listen queue len     - the size of the socket queue of pending connections;
149
;   idle processes       - the number of idle processes;
150
;   active processes     - the number of active processes;
151
;   total processes      - the number of idle + active processes;
152
;   max active processes - the maximum number of active processes since FPM
153
;                          has started;
154
;   max children reached - number of times, the process limit has been reached,
155
;                          when pm tries to start more children (works only for
156
;                          pm 'dynamic' and 'ondemand');
157
; Value are updated in real time.
158
; Example output:
159
;   pool:                 www
160
;   process manager:      static
161
;   start time:           01/Jul/2011:17:53:49 +0200
162
;   start since:          62636
163
;   accepted conn:        190460
164
;   listen queue:         0
165
;   max listen queue:     1
166
;   listen queue len:     42
167
;   idle processes:       4
168
;   active processes:     11
169
;   total processes:      15
170
;   max active processes: 12
171
;   max children reached: 0
172
;
173
; By default the status page output is formatted as text/plain. Passing either
174
; 'html', 'xml' or 'json' in the query string will return the corresponding
175
; output syntax. Example:
176
;   http://www.foo.bar/status
177
;   http://www.foo.bar/status?json
178
;   http://www.foo.bar/status?html
179
;   http://www.foo.bar/status?xml
180
;
181
; By default the status page only outputs short status. Passing 'full' in the
182
; query string will also return status for each pool process.
183
; Example: 
184
;   http://www.foo.bar/status?full
185
;   http://www.foo.bar/status?json&full
186
;   http://www.foo.bar/status?html&full
187
;   http://www.foo.bar/status?xml&full
188
; The Full status returns for each process:
189
;   pid                  - the PID of the process;
190
;   state                - the state of the process (Idle, Running, ...);
191
;   start time           - the date and time the process has started;
192
;   start since          - the number of seconds since the process has started;
193
;   requests             - the number of requests the process has served;
194
;   request duration     - the duration in µs of the requests;
195
;   request method       - the request method (GET, POST, ...);
196
;   request URI          - the request URI with the query string;
197
;   content length       - the content length of the request (only with POST);
198
;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
199
;   script               - the main script called (or '-' if not set);
200
;   last request cpu     - the %cpu the last request consumed
201
;                          it's always 0 if the process is not in Idle state
202
;                          because CPU calculation is done when the request
203
;                          processing has terminated;
204
;   last request memory  - the max amount of memory the last request consumed
205
;                          it's always 0 if the process is not in Idle state
206
;                          because memory calculation is done when the request
207
;                          processing has terminated;
208
; If the process is in Idle state, then informations are related to the
209
; last request the process has served. Otherwise informations are related to
210
; the current request being served.
211
; Example output:
212
;   ************************
213
;   pid:                  31330
214
;   state:                Running
215
;   start time:           01/Jul/2011:17:53:49 +0200
216
;   start since:          63087
217
;   requests:             12808
218
;   request duration:     1250261
219
;   request method:       GET
220
;   request URI:          /test_mem.php?N=10000
221
;   content length:       0
222
;   user:                 -
223
;   script:               /home/fat/web/docs/php/test_mem.php
224
;   last request cpu:     0.00
225
;   last request memory:  0
226
;
227
; Note: There is a real-time FPM status monitoring sample web page available
228
;       It's available in: /usr/share/php5/fpm/status.html
229
;
230
; Note: The value must start with a leading slash (/). The value can be
231
;       anything, but it may not be a good idea to use the .php extension or it
232
;       may conflict with a real PHP file.
233
; Default Value: not set 
234
;pm.status_path = /status
235
 
236
; The ping URI to call the monitoring page of FPM. If this value is not set, no
237
; URI will be recognized as a ping page. This could be used to test from outside
238
; that FPM is alive and responding, or to
239
; - create a graph of FPM availability (rrd or such);
240
; - remove a server from a group if it is not responding (load balancing);
241
; - trigger alerts for the operating team (24/7).
242
; Note: The value must start with a leading slash (/). The value can be
243
;       anything, but it may not be a good idea to use the .php extension or it
244
;       may conflict with a real PHP file.
245
; Default Value: not set
246
;ping.path = /ping
247

            
248
; This directive may be used to customize the response of a ping request. The
249
; response is formatted as text/plain with a 200 response code.
250
; Default Value: pong
251
;ping.response = pong
252

            
253
; The access log file
254
; Default: not set
255
;access.log = log/$pool.access.log
256

            
257
; The access log format.
258
; The following syntax is allowed
259
;  %%: the '%' character
260
;  %C: %CPU used by the request
261
;      it can accept the following format:
262
;      - %{user}C for user CPU only
263
;      - %{system}C for system CPU only
264
;      - %{total}C  for user + system CPU (default)
265
;  %d: time taken to serve the request
266
;      it can accept the following format:
267
;      - %{seconds}d (default)
268
;      - %{miliseconds}d
269
;      - %{mili}d
270
;      - %{microseconds}d
271
;      - %{micro}d
272
;  %e: an environment variable (same as $_ENV or $_SERVER)
273
;      it must be associated with embraces to specify the name of the env
274
;      variable. Some exemples:
275
;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
276
;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
277
;  %f: script filename
278
;  %l: content-length of the request (for POST request only)
279
;  %m: request method
280
;  %M: peak of memory allocated by PHP
281
;      it can accept the following format:
282
;      - %{bytes}M (default)
283
;      - %{kilobytes}M
284
;      - %{kilo}M
285
;      - %{megabytes}M
286
;      - %{mega}M
287
;  %n: pool name
288
;  %o: output header
289
;      it must be associated with embraces to specify the name of the header:
290
;      - %{Content-Type}o
291
;      - %{X-Powered-By}o
292
;      - %{Transfert-Encoding}o
293
;      - ....
294
;  %p: PID of the child that serviced the request
295
;  %P: PID of the parent of the child that serviced the request
296
;  %q: the query string 
297
;  %Q: the '?' character if query string exists
298
;  %r: the request URI (without the query string, see %q and %Q)
299
;  %R: remote IP address
300
;  %s: status (response code)
301
;  %t: server time the request was received
302
;      it can accept a strftime(3) format:
303
;      %d/%b/%Y:%H:%M:%S %z (default)
304
;  %T: time the log has been written (the request has finished)
305
;      it can accept a strftime(3) format:
306
;      %d/%b/%Y:%H:%M:%S %z (default)
307
;  %u: remote user
308
;
309
; Default: "%R - %u %t \"%m %r\" %s"
310
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
311
 
312
; The log file for slow requests
313
; Default Value: not set
314
; Note: slowlog is mandatory if request_slowlog_timeout is set
315
;slowlog = log/$pool.log.slow
316
 
317
; The timeout for serving a single request after which a PHP backtrace will be
318
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
319
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
320
; Default Value: 0
321
;request_slowlog_timeout = 0
322
 
323
; The timeout for serving a single request after which the worker process will
324
; be killed. This option should be used when the 'max_execution_time' ini option
325
; does not stop script execution for some reason. A value of '0' means 'off'.
326
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
327
; Default Value: 0
328
;request_terminate_timeout = 0
329
 
330
; Set open file descriptor rlimit.
331
; Default Value: system defined value
332
;rlimit_files = 1024
333
 
334
; Set max core size rlimit.
335
; Possible Values: 'unlimited' or an integer greater or equal to 0
336
; Default Value: system defined value
337
;rlimit_core = 0
338
 
339
; Chroot to this directory at the start. This value must be defined as an
340
; absolute path. When this value is not set, chroot is not used.
341
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
342
; of its subdirectories. If the pool prefix is not set, the global prefix
343
; will be used instead.
344
; Note: chrooting is a great security feature and should be used whenever 
345
;       possible. However, all PHP paths will be relative to the chroot
346
;       (error_log, sessions.save_path, ...).
347
; Default Value: not set
348
;chroot = 
349
 
350
; Chdir to this directory at the start.
351
; Note: relative path can be used.
352
; Default Value: current directory or / when chroot
353
chdir = /
354
 
355
; Redirect worker stdout and stderr into main error log. If not set, stdout and
356
; stderr will be redirected to /dev/null according to FastCGI specs.
357
; Note: on highloaded environement, this can cause some delay in the page
358
; process time (several ms).
359
; Default Value: no
360
;catch_workers_output = yes
361

            
362
; Clear environment in FPM workers
363
; Prevents arbitrary environment variables from reaching FPM worker processes
364
; by clearing the environment in workers before env vars specified in this
365
; pool configuration are added.
366
; Setting to "no" will make all environment variables available to PHP code
367
; via getenv(), $_ENV and $_SERVER.
368
; Default Value: yes
369
;clear_env = no
370

            
371
; Limits the extensions of the main script FPM will allow to parse. This can
372
; prevent configuration mistakes on the web server side. You should only limit
373
; FPM to .php extensions to prevent malicious users to use other extensions to
374
; exectute php code.
375
; Note: set an empty value to allow all extensions.
376
; Default Value: .php
377
;security.limit_extensions = .php .php3 .php4 .php5
378
security.limit_extensions = 
379

            
380
 
381
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
382
; the current environment.
383
; Default Value: clean env
384
;env[HOSTNAME] = $HOSTNAME
385
env[PATH] = /usr/local/bin:/usr/bin:/bin
386
;env[TMP] = /tmp
387
;env[TMPDIR] = /tmp
388
;env[TEMP] = /tmp
389

            
390
; Additional php.ini defines, specific to this pool of workers. These settings
391
; overwrite the values previously defined in the php.ini. The directives are the
392
; same as the PHP SAPI:
393
;   php_value/php_flag             - you can set classic ini defines which can
394
;                                    be overwritten from PHP call 'ini_set'. 
395
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
396
;                                     PHP call 'ini_set'
397
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
398

            
399
; Defining 'extension' will load the corresponding shared extension from
400
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
401
; overwrite previously defined php.ini values, but will append the new value
402
; instead.
403

            
404
; Note: path INI options can be relative and will be expanded with the prefix
405
; (pool, global or /usr)
406

            
407
; Default Value: nothing is defined by default except the values in php.ini and
408
;                specified at startup with the -d argument
409
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
410
;php_flag[display_errors] = off
411
;php_admin_value[error_log] = /var/log/fpm-php.www.log
412
;php_admin_flag[log_errors] = on
413
;php_admin_value[memory_limit] = 32M