Advertisement
Guest User

Untitled

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