2
0

www.conf 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. ; Start a new pool named 'www'.
  2. ; the variable $pool can be used in any directive and will be replaced by the
  3. ; pool name ('www' here)
  4. [www]
  5. ; Per pool prefix
  6. ; It only applies on the following directives:
  7. ; - 'access.log'
  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. ; Unix user/group of the child processes. This can be used only if the master
  19. ; process running user is root. It is set after the child process is created.
  20. ; The user and group can be specified either by their name or by their numeric
  21. ; IDs.
  22. ; Note: If the user is root, the executable needs to be started with
  23. ; --allow-to-run-as-root option to work.
  24. ; Default Values: The user is set to master process running user by default.
  25. ; If the group is not set, the user's group is used.
  26. user = www-data
  27. group = www-data
  28. ; The address on which to accept FastCGI requests.
  29. ; Valid syntaxes are:
  30. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
  31. ; a specific port;
  32. ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  33. ; a 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 = /run/php/php8.3-fpm.sock
  39. listen = 0.0.0.0:9000
  40. ; Set listen(2) backlog.
  41. ; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
  42. ;listen.backlog = 511
  43. ; Set permissions for unix socket, if one is used. In Linux, read/write
  44. ; permissions must be set in order to allow connections from a web server. Many
  45. ; BSD-derived systems allow connections regardless of permissions. The owner
  46. ; and group can be specified either by name or by their numeric IDs.
  47. ; Default Values: Owner is set to the master process running user. If the group
  48. ; is not set, the owner's group is used. 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. ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
  58. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  59. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  60. ; must be separated by a comma. If this value is left blank, connections will be
  61. ; accepted from any ip address.
  62. ; Default Value: any
  63. ;listen.allowed_clients = 127.0.0.1
  64. ; Set the associated the route table (FIB). FreeBSD only
  65. ; Default Value: -1
  66. ;listen.setfib = 1
  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. ; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
  75. ; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
  76. ; or group is different than the master process user. It allows to create process
  77. ; core dump and ptrace the process for the pool user.
  78. ; Default Value: no
  79. ; process.dumpable = yes
  80. ; Choose how the process manager will control the number of child processes.
  81. ; Possible Values:
  82. ; static - a fixed number (pm.max_children) of child processes;
  83. ; dynamic - the number of child processes are set dynamically based on the
  84. ; following directives. With this process management, there will be
  85. ; always at least 1 children.
  86. ; pm.max_children - the maximum number of children that can
  87. ; be alive at the same time.
  88. ; pm.start_servers - the number of children created on startup.
  89. ; pm.min_spare_servers - the minimum number of children in 'idle'
  90. ; state (waiting to process). If the number
  91. ; of 'idle' processes is less than this
  92. ; number then some children will be created.
  93. ; pm.max_spare_servers - the maximum number of children in 'idle'
  94. ; state (waiting to process). If the number
  95. ; of 'idle' processes is greater than this
  96. ; number then some children will be killed.
  97. ; pm.max_spawn_rate - the maximum number of rate to spawn child
  98. ; processes at once.
  99. ; ondemand - no children are created at startup. Children will be forked when
  100. ; new requests will connect. The following parameter are used:
  101. ; pm.max_children - the maximum number of children that
  102. ; can be alive at the same time.
  103. ; pm.process_idle_timeout - The number of seconds after which
  104. ; an idle process will be killed.
  105. ; Note: This value is mandatory.
  106. pm = dynamic
  107. ; The number of child processes to be created when pm is set to 'static' and the
  108. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  109. ; This value sets the limit on the number of simultaneous requests that will be
  110. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  111. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  112. ; CGI. The below defaults are based on a server without much resources. Don't
  113. ; forget to tweak pm.* to fit your needs.
  114. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
  115. ; Note: This value is mandatory.
  116. pm.max_children = 20
  117. ; The number of child processes created on startup.
  118. ; Note: Used only when pm is set to 'dynamic'
  119. ; Default Value: (min_spare_servers + max_spare_servers) / 2
  120. pm.start_servers = 4
  121. ; The desired minimum 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.min_spare_servers = 2
  125. ; The desired maximum number of idle server processes.
  126. ; Note: Used only when pm is set to 'dynamic'
  127. ; Note: Mandatory when pm is set to 'dynamic'
  128. pm.max_spare_servers = 4
  129. ; The number of rate to spawn child processes at once.
  130. ; Note: Used only when pm is set to 'dynamic'
  131. ; Note: Mandatory when pm is set to 'dynamic'
  132. ; Default Value: 32
  133. ;pm.max_spawn_rate = 32
  134. ; The number of seconds after which an idle process will be killed.
  135. ; Note: Used only when pm is set to 'ondemand'
  136. ; Default Value: 10s
  137. ;pm.process_idle_timeout = 10s;
  138. ; The number of requests each child process should execute before respawning.
  139. ; This can be useful to work around memory leaks in 3rd party libraries. For
  140. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  141. ; Default Value: 0
  142. ;pm.max_requests = 500
  143. ; The URI to view the FPM status page. If this value is not set, no URI will be
  144. ; recognized as a status page. It shows the following information:
  145. ; pool - the name of the pool;
  146. ; process manager - static, dynamic or ondemand;
  147. ; start time - the date and time FPM has started;
  148. ; start since - number of seconds since FPM has started;
  149. ; accepted conn - the number of request accepted by the pool;
  150. ; listen queue - the number of request in the queue of pending
  151. ; connections (see backlog in listen(2));
  152. ; max listen queue - the maximum number of requests in the queue
  153. ; of pending connections since FPM has started;
  154. ; listen queue len - the size of the socket queue of pending connections;
  155. ; idle processes - the number of idle processes;
  156. ; active processes - the number of active processes;
  157. ; total processes - the number of idle + active processes;
  158. ; max active processes - the maximum number of active processes since FPM
  159. ; has started;
  160. ; max children reached - number of times, the process limit has been reached,
  161. ; when pm tries to start more children (works only for
  162. ; pm 'dynamic' and 'ondemand');
  163. ; Value are updated in real time.
  164. ; Example output:
  165. ; pool: www
  166. ; process manager: static
  167. ; start time: 01/Jul/2011:17:53:49 +0200
  168. ; start since: 62636
  169. ; accepted conn: 190460
  170. ; listen queue: 0
  171. ; max listen queue: 1
  172. ; listen queue len: 42
  173. ; idle processes: 4
  174. ; active processes: 11
  175. ; total processes: 15
  176. ; max active processes: 12
  177. ; max children reached: 0
  178. ;
  179. ; By default the status page output is formatted as text/plain. Passing either
  180. ; 'html', 'xml' or 'json' in the query string will return the corresponding
  181. ; output syntax. Example:
  182. ; http://www.foo.bar/status
  183. ; http://www.foo.bar/status?json
  184. ; http://www.foo.bar/status?html
  185. ; http://www.foo.bar/status?xml
  186. ;
  187. ; By default the status page only outputs short status. Passing 'full' in the
  188. ; query string will also return status for each pool process.
  189. ; Example:
  190. ; http://www.foo.bar/status?full
  191. ; http://www.foo.bar/status?json&full
  192. ; http://www.foo.bar/status?html&full
  193. ; http://www.foo.bar/status?xml&full
  194. ; The Full status returns for each process:
  195. ; pid - the PID of the process;
  196. ; state - the state of the process (Idle, Running, ...);
  197. ; start time - the date and time the process has started;
  198. ; start since - the number of seconds since the process has started;
  199. ; requests - the number of requests the process has served;
  200. ; request duration - the duration in µs of the requests;
  201. ; request method - the request method (GET, POST, ...);
  202. ; request URI - the request URI with the query string;
  203. ; content length - the content length of the request (only with POST);
  204. ; user - the user (PHP_AUTH_USER) (or '-' if not set);
  205. ; script - the main script called (or '-' if not set);
  206. ; last request cpu - the %cpu the last request consumed
  207. ; it's always 0 if the process is not in Idle state
  208. ; because CPU calculation is done when the request
  209. ; processing has terminated;
  210. ; last request memory - the max amount of memory the last request consumed
  211. ; it's always 0 if the process is not in Idle state
  212. ; because memory calculation is done when the request
  213. ; processing has terminated;
  214. ; If the process is in Idle state, then informations are related to the
  215. ; last request the process has served. Otherwise informations are related to
  216. ; the current request being served.
  217. ; Example output:
  218. ; ************************
  219. ; pid: 31330
  220. ; state: Running
  221. ; start time: 01/Jul/2011:17:53:49 +0200
  222. ; start since: 63087
  223. ; requests: 12808
  224. ; request duration: 1250261
  225. ; request method: GET
  226. ; request URI: /test_mem.php?N=10000
  227. ; content length: 0
  228. ; user: -
  229. ; script: /home/fat/web/docs/php/test_mem.php
  230. ; last request cpu: 0.00
  231. ; last request memory: 0
  232. ;
  233. ; Note: There is a real-time FPM status monitoring sample web page available
  234. ; It's available in: /usr/share/php/8.3/fpm/status.html
  235. ;
  236. ; Note: The value must start with a leading slash (/). The value can be
  237. ; anything, but it may not be a good idea to use the .php extension or it
  238. ; may conflict with a real PHP file.
  239. ; Default Value: not set
  240. ;pm.status_path = /status
  241. ; The address on which to accept FastCGI status request. This creates a new
  242. ; invisible pool that can handle requests independently. This is useful
  243. ; if the main pool is busy with long running requests because it is still possible
  244. ; to get the status before finishing the long running requests.
  245. ;
  246. ; Valid syntaxes are:
  247. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
  248. ; a specific port;
  249. ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  250. ; a specific port;
  251. ; 'port' - to listen on a TCP socket to all addresses
  252. ; (IPv6 and IPv4-mapped) on a specific port;
  253. ; '/path/to/unix/socket' - to listen on a unix socket.
  254. ; Default Value: value of the listen option
  255. ;pm.status_listen = 127.0.0.1:9001
  256. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  257. ; URI will be recognized as a ping page. This could be used to test from outside
  258. ; that FPM is alive and responding, or to
  259. ; - create a graph of FPM availability (rrd or such);
  260. ; - remove a server from a group if it is not responding (load balancing);
  261. ; - trigger alerts for the operating team (24/7).
  262. ; Note: The value must start with a leading slash (/). The value can be
  263. ; anything, but it may not be a good idea to use the .php extension or it
  264. ; may conflict with a real PHP file.
  265. ; Default Value: not set
  266. ;ping.path = /ping
  267. ; This directive may be used to customize the response of a ping request. The
  268. ; response is formatted as text/plain with a 200 response code.
  269. ; Default Value: pong
  270. ;ping.response = pong
  271. ; The access log file
  272. ; Default: not set
  273. ;access.log = log/$pool.access.log
  274. ; The access log format.
  275. ; The following syntax is allowed
  276. ; %%: the '%' character
  277. ; %C: %CPU used by the request
  278. ; it can accept the following format:
  279. ; - %{user}C for user CPU only
  280. ; - %{system}C for system CPU only
  281. ; - %{total}C for user + system CPU (default)
  282. ; %d: time taken to serve the request
  283. ; it can accept the following format:
  284. ; - %{seconds}d (default)
  285. ; - %{milliseconds}d
  286. ; - %{milli}d
  287. ; - %{microseconds}d
  288. ; - %{micro}d
  289. ; %e: an environment variable (same as $_ENV or $_SERVER)
  290. ; it must be associated with embraces to specify the name of the env
  291. ; variable. Some examples:
  292. ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
  293. ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
  294. ; %f: script filename
  295. ; %l: content-length of the request (for POST request only)
  296. ; %m: request method
  297. ; %M: peak of memory allocated by PHP
  298. ; it can accept the following format:
  299. ; - %{bytes}M (default)
  300. ; - %{kilobytes}M
  301. ; - %{kilo}M
  302. ; - %{megabytes}M
  303. ; - %{mega}M
  304. ; %n: pool name
  305. ; %o: output header
  306. ; it must be associated with embraces to specify the name of the header:
  307. ; - %{Content-Type}o
  308. ; - %{X-Powered-By}o
  309. ; - %{Transfert-Encoding}o
  310. ; - ....
  311. ; %p: PID of the child that serviced the request
  312. ; %P: PID of the parent of the child that serviced the request
  313. ; %q: the query string
  314. ; %Q: the '?' character if query string exists
  315. ; %r: the request URI (without the query string, see %q and %Q)
  316. ; %R: remote IP address
  317. ; %s: status (response code)
  318. ; %t: server time the request was received
  319. ; it can accept a strftime(3) format:
  320. ; %d/%b/%Y:%H:%M:%S %z (default)
  321. ; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
  322. ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
  323. ; %T: time the log has been written (the request has finished)
  324. ; it can accept a strftime(3) format:
  325. ; %d/%b/%Y:%H:%M:%S %z (default)
  326. ; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
  327. ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
  328. ; %u: remote user
  329. ;
  330. ; Default: "%R - %u %t \"%m %r\" %s"
  331. ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
  332. ; A list of request_uri values which should be filtered from the access log.
  333. ;
  334. ; As a security precuation, this setting will be ignored if:
  335. ; - the request method is not GET or HEAD; or
  336. ; - there is a request body; or
  337. ; - there are query parameters; or
  338. ; - the response code is outwith the successful range of 200 to 299
  339. ;
  340. ; Note: The paths are matched against the output of the access.format tag "%r".
  341. ; On common configurations, this may look more like SCRIPT_NAME than the
  342. ; expected pre-rewrite URI.
  343. ;
  344. ; Default Value: not set
  345. ;access.suppress_path[] = /ping
  346. ;access.suppress_path[] = /health_check.php
  347. ; The log file for slow requests
  348. ; Default Value: not set
  349. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  350. ;slowlog = log/$pool.log.slow
  351. ; The timeout for serving a single request after which a PHP backtrace will be
  352. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  353. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  354. ; Default Value: 0
  355. ;request_slowlog_timeout = 0
  356. ; Depth of slow log stack trace.
  357. ; Default Value: 20
  358. ;request_slowlog_trace_depth = 20
  359. ; The timeout for serving a single request after which the worker process will
  360. ; be killed. This option should be used when the 'max_execution_time' ini option
  361. ; does not stop script execution for some reason. A value of '0' means 'off'.
  362. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  363. ; Default Value: 0
  364. ;request_terminate_timeout = 0
  365. ; The timeout set by 'request_terminate_timeout' ini option is not engaged after
  366. ; application calls 'fastcgi_finish_request' or when application has finished and
  367. ; shutdown functions are being called (registered via register_shutdown_function).
  368. ; This option will enable timeout limit to be applied unconditionally
  369. ; even in such cases.
  370. ; Default Value: no
  371. ;request_terminate_timeout_track_finished = no
  372. ; Set open file descriptor rlimit.
  373. ; Default Value: system defined value
  374. ;rlimit_files = 1024
  375. ; Set max core size rlimit.
  376. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  377. ; Default Value: system defined value
  378. ;rlimit_core = 0
  379. ; Chroot to this directory at the start. This value must be defined as an
  380. ; absolute path. When this value is not set, chroot is not used.
  381. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  382. ; of its subdirectories. If the pool prefix is not set, the global prefix
  383. ; will be used instead.
  384. ; Note: chrooting is a great security feature and should be used whenever
  385. ; possible. However, all PHP paths will be relative to the chroot
  386. ; (error_log, sessions.save_path, ...).
  387. ; Default Value: not set
  388. ;chroot =
  389. ; Chdir to this directory at the start.
  390. ; Note: relative path can be used.
  391. ; Default Value: current directory or / when chroot
  392. ;chdir = /var/www
  393. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  394. ; stderr will be redirected to /dev/null according to FastCGI specs.
  395. ; Note: on highloaded environment, this can cause some delay in the page
  396. ; process time (several ms).
  397. ; Default Value: no
  398. ;catch_workers_output = yes
  399. ; Decorate worker output with prefix and suffix containing information about
  400. ; the child that writes to the log and if stdout or stderr is used as well as
  401. ; log level and time. This options is used only if catch_workers_output is yes.
  402. ; Settings to "no" will output data as written to the stdout or stderr.
  403. ; Default value: yes
  404. ;decorate_workers_output = no
  405. ; Clear environment in FPM workers
  406. ; Prevents arbitrary environment variables from reaching FPM worker processes
  407. ; by clearing the environment in workers before env vars specified in this
  408. ; pool configuration are added.
  409. ; Setting to "no" will make all environment variables available to PHP code
  410. ; via getenv(), $_ENV and $_SERVER.
  411. ; Default Value: yes
  412. clear_env = no
  413. ; Limits the extensions of the main script FPM will allow to parse. This can
  414. ; prevent configuration mistakes on the web server side. You should only limit
  415. ; FPM to .php extensions to prevent malicious users to use other extensions to
  416. ; execute php code.
  417. ; Note: set an empty value to allow all extensions.
  418. ; Default Value: .php
  419. ;security.limit_extensions = .php .php3 .php4 .php5 .php7
  420. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  421. ; the current environment.
  422. ; Default Value: clean env
  423. env[HOSTNAME] = $HOSTNAME
  424. env[PATH] = /usr/local/bin:/usr/bin:/bin
  425. env[TMP] = /tmp
  426. env[TMPDIR] = /tmp
  427. env[TEMP] = /tmp
  428. ; Additional php.ini defines, specific to this pool of workers. These settings
  429. ; overwrite the values previously defined in the php.ini. The directives are the
  430. ; same as the PHP SAPI:
  431. ; php_value/php_flag - you can set classic ini defines which can
  432. ; be overwritten from PHP call 'ini_set'.
  433. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  434. ; PHP call 'ini_set'
  435. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  436. ; Defining 'extension' will load the corresponding shared extension from
  437. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  438. ; overwrite previously defined php.ini values, but will append the new value
  439. ; instead.
  440. ; Note: path INI options can be relative and will be expanded with the prefix
  441. ; (pool, global or /usr)
  442. ; Default Value: nothing is defined by default except the values in php.ini and
  443. ; specified at startup with the -d argument
  444. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  445. ;php_flag[display_errors] = off
  446. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  447. ;php_admin_flag[log_errors] = on
  448. ;php_admin_value[memory_limit] = 32M