Advertisement
Guest User

mydomain-php-fpm.conf

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