Advertisement
javipas

PHP-FPM config for muycomputerpro server

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