Advertisement
apurvasukant

php-fpm-www-pool.conf

Oct 19th, 2012
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.55 KB | None | 0 0
  1. ; Start a new PHP-FPM 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. ; - 'slowlog'
  9. ; - 'listen' (unixsocket)
  10. ; - 'chroot'
  11. ; - 'chdir'
  12. ; - 'php_values'
  13. ; - 'php_admin_values'
  14. ; When not set, the global prefix (or /usr) applies instead.
  15. ; Note: This directive can also be relative to the global prefix.
  16. ; Default Value: none
  17. ;prefix = /path/to/pools/$pool
  18.  
  19. ; Unix user/group of processes
  20. ; Note: The user is mandatory. If the group is not set, the default user's group
  21. ; will be used.
  22. user = www-data
  23. group = www-data
  24.  
  25. ; The address on which to accept FastCGI requests.
  26. ; Valid syntaxes are:
  27. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
  28. ; a specific port;
  29. ; 'port' - to listen on a TCP socket to all addresses on a
  30. ; specific port;
  31. ; '/path/to/unix/socket' - to listen on a unix socket.
  32. ; Note: This value is mandatory.
  33. listen = 127.0.0.1:9000
  34.  
  35. ; Set listen(2) backlog. A value of '-1' means unlimited.
  36. ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
  37. listen.backlog = -1
  38.  
  39. ; Set permissions for unix socket, if one is used. In Linux, read/write
  40. ; permissions must be set in order to allow connections from a web server. Many
  41. ; BSD-derived systems allow connections regardless of permissions.
  42. ; Default Values: user and group are set as the running user
  43. ; mode is set to 0666
  44. listen.owner = www-data
  45. listen.group = www-data
  46. ;listen.mode = 0666
  47.  
  48. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  49. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  50. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  51. ; must be separated by a comma. If this value is left blank, connections will be
  52. ; accepted from any ip address.
  53. ; Default Value: any
  54. ;listen.allowed_clients = 127.0.0.1
  55.  
  56. ; Choose how the process manager will control the number of child processes.
  57. pm = dynamic
  58.  
  59. ; The number of child processes to be created when pm is set to 'static' and the
  60. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  61. pm.max_children = 8
  62.  
  63. ; The number of child processes created on startup.
  64. ; Note: Used only when pm is set to 'dynamic'
  65. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  66. pm.start_servers = 8
  67.  
  68. ; The desired minimum number of idle server processes.
  69. ; Note: Used only when pm is set to 'dynamic'
  70. ; Note: Mandatory when pm is set to 'dynamic'
  71. pm.min_spare_servers = 4
  72.  
  73. ; The desired maximum number of idle server processes.
  74. ; Note: Used only when pm is set to 'dynamic'
  75. ; Note: Mandatory when pm is set to 'dynamic'
  76. pm.max_spare_servers = 6
  77.  
  78. ; The number of seconds after which an idle process will be killed.
  79. ; Note: Used only when pm is set to 'ondemand'
  80. ; Default Value: 10s
  81. ;pm.process_idle_timeout = 10s;
  82.  
  83. ; The number of requests each child process should execute before respawning.
  84. ; This can be useful to work around memory leaks in 3rd party libraries. For
  85. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  86. ; Default Value: 0
  87. pm.max_requests = 0
  88.  
  89.  
  90. ; Note: There is a real-time FPM status monitoring sample web page available
  91. ; It's available in: ${prefix}/share/fpm/status.html
  92. ;
  93. ; Note: The value must start with a leading slash (/). The value can be
  94. ; anything, but it may not be a good idea to use the .php extension or it
  95. ; may conflict with a real PHP file.
  96. ; Default Value: not set
  97. ;pm.status_path = /status
  98.  
  99. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  100. ; URI will be recognized as a ping page. This could be used to test from outside
  101. ; that FPM is alive and responding, or to
  102. ; - create a graph of FPM availability (rrd or such);
  103. ; - remove a server from a group if it is not responding (load balancing);
  104. ; - trigger alerts for the operating team (24/7).
  105. ; Note: The value must start with a leading slash (/). The value can be
  106. ; anything, but it may not be a good idea to use the .php extension or it
  107. ; may conflict with a real PHP file.
  108. ; Default Value: not set
  109. ;ping.path = /ping
  110.  
  111. ; This directive may be used to customize the response of a ping request. The
  112. ; response is formatted as text/plain with a 200 response code.
  113. ; Default Value: pong
  114. ;ping.response = pong
  115.  
  116. ; The access log file
  117. ; Default: not set
  118. ;access.log = log/$pool.access.log
  119. ;access.format = %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%
  120.  
  121. ; The log file for slow requests
  122. ; Default Value: not set
  123. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  124. ;slowlog = log/$pool.log.slow
  125.  
  126. ; The timeout for serving a single request after which a PHP backtrace will be
  127. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  128. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  129. ; Default Value: 0
  130. ;request_slowlog_timeout = 0
  131.  
  132. ; The timeout for serving a single request after which the worker process will
  133. ; be killed. This option should be used when the 'max_execution_time' ini option
  134. ; does not stop script execution for some reason. A value of '0' means 'off'.
  135. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  136. ; Default Value: 0
  137. ;request_terminate_timeout = 0
  138.  
  139. ; Set open file descriptor rlimit.
  140. ; Default Value: system defined value
  141. rlimit_files = 30000
  142.  
  143. ; Set max core size rlimit.
  144. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  145. ; Default Value: system defined value
  146. ;rlimit_core = unlimited
  147.  
  148. ; Chroot to this directory at the start. This value must be defined as an
  149. ; absolute path. When this value is not set, chroot is not used.
  150. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  151. ; of its subdirectories. If the pool prefix is not set, the global prefix
  152. ; will be used instead.
  153. ; Note: chrooting is a great security feature and should be used whenever
  154. ; possible. However, all PHP paths will be relative to the chroot
  155. ; (error_log, sessions.save_path, ...).
  156. ; Default Value: not set
  157. ;chroot =
  158.  
  159. ; Chdir to this directory at the start.
  160. ; Note: relative path can be used.
  161. ; Default Value: current directory or / when chroot
  162. chdir = /
  163.  
  164. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  165. ; stderr will be redirected to /dev/null according to FastCGI specs.
  166. ; Note: on highloaded environement, this can cause some delay in the page
  167. ; process time (several ms).
  168. ; Default Value: no
  169. ;catch_workers_output = yes
  170.  
  171. ; Limits the extensions of the main script FPM will allow to parse. This can
  172. ; prevent configuration mistakes on the web server side. You should only limit
  173. ; FPM to .php extensions to prevent malicious users to use other extensions to
  174. ; exectute php code.
  175. ; Note: set an empty value to allow all extensions.
  176. ; Default Value: .php
  177. security.limit_extensions = .php .php3 .php4 .php5
  178.  
  179. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  180. ; the current environment.
  181. ; Default Value: clean env
  182. ;env[HOSTNAME] = droid.ly
  183. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  184. ;env[TMP] = /tmp
  185. ;env[TMPDIR] = /tmp
  186. ;env[TEMP] = /tmp
  187.  
  188. ; Additional php.ini defines, specific to this pool of workers. These settings
  189. ; overwrite the values previously defined in the php.ini. The directives are the
  190. ; same as the PHP SAPI:
  191. ; php_value/php_flag - you can set classic ini defines which can
  192. ; be overwritten from PHP call 'ini_set'.
  193. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  194. ; PHP call 'ini_set'
  195. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  196.  
  197. ; Defining 'extension' will load the corresponding shared extension from
  198. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  199. ; overwrite previously defined php.ini values, but will append the new value
  200. ; instead.
  201.  
  202. ; Note: path INI options can be relative and will be expanded with the prefix
  203. ; (pool, global or /usr)
  204.  
  205. ; Default Value: nothing is defined by default except the values in php.ini and
  206. ; specified at startup with the -d argument
  207. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  208. ;php_flag[display_errors] = off
  209. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  210. ;php_admin_flag[log_errors] = on
  211. ;php_admin_value[memory_limit] = 32M
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement