Advertisement
Guest User

/etc/php/php-fpm.d/nextcloud.conf

a guest
Mar 2nd, 2022
41
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 20.54 KB
  1. [nextcloud]
  2.  
  3. ; Per pool prefix
  4. ; It only applies on the following directives:
  5. ; - 'access.log'
  6. ; - 'slowlog'
  7. ; - 'listen' (unixsocket)
  8. ; - 'chroot'
  9. ; - 'chdir'
  10. ; - 'php_values'
  11. ; - 'php_admin_values'
  12. ; When not set, the global prefix (or /usr) applies instead.
  13. ; Note: This directive can also be relative to the global prefix.
  14. ; Default Value: none
  15. ;prefix = /path/to/pools/$pool
  16.  
  17. ; Unix user/group of processes
  18. ; Note: The user is mandatory. If the group is not set, the default user's group
  19. ;       will be used.
  20. user = nextcloud
  21. group = nextcloud
  22.  
  23. ; The address on which to accept FastCGI requests.
  24. ; Valid syntaxes are:
  25. ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
  26. ;                            a specific port;
  27. ;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  28. ;                            a specific port;
  29. ;   'port'                 - to listen on a TCP socket to all addresses
  30. ;                            (IPv6 and IPv4-mapped) on a specific port;
  31. ;   '/path/to/unix/socket' - to listen on a unix socket.
  32. ; Note: This value is mandatory.
  33. listen = /run/php-fpm/nextcloud.sock
  34.  
  35.  
  36.  
  37. ; Set permissions for unix socket, if one is used. In Linux, read/write
  38. ; permissions must be set in order to allow connections from a web server. Many
  39. ; BSD-derived systems allow connections regardless of permissions. The owner
  40. ; and group can be specified either by name or by their numeric IDs.
  41. ; Default Values: user and group are set as the running user
  42. ;                 mode is set to 0660
  43. listen.owner = nextcloud
  44. listen.group = http
  45. listen.mode = 0660
  46. ; When POSIX Access Control Lists are supported you can set them using
  47. ; these options, value is a comma separated list of user/group names.
  48. ; When set, listen.owner and listen.group are ignored
  49. ;listen.acl_users =
  50. ;listen.acl_groups =
  51.  
  52. ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
  53. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  54. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  55. ; must be separated by a comma. If this value is left blank, connections will be
  56. ; accepted from any ip address.
  57. ; Default Value: any
  58. ;listen.allowed_clients = 127.0.0.1
  59.  
  60. ; Specify the nice(2) priority to apply to the pool processes (only if set)
  61. ; The value can vary from -19 (highest priority) to 20 (lower priority)
  62. ; Note: - It will only work if the FPM master process is launched as root
  63. ;       - The pool processes will inherit the master process priority
  64. ;         unless it specified otherwise
  65. ; Default Value: no set
  66. ; process.priority = -19
  67.  
  68. ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
  69. ; or group is different than the master process user. It allows to create process
  70. ; core dump and ptrace the process for the pool user.
  71. ; Default Value: no
  72. ; process.dumpable = yes
  73.  
  74. ; Choose how the process manager will control the number of child processes.
  75. ; Possible Values:
  76. ;   static  - a fixed number (pm.max_children) of child processes;
  77. ;   dynamic - the number of child processes are set dynamically based on the
  78. ;             following directives. With this process management, there will be
  79. ;             always at least 1 children.
  80. ;             pm.max_children      - the maximum number of children that can
  81. ;                                    be alive at the same time.
  82. ;             pm.start_servers     - the number of children created on startup.
  83. ;             pm.min_spare_servers - the minimum number of children in 'idle'
  84. ;                                    state (waiting to process). If the number
  85. ;                                    of 'idle' processes is less than this
  86. ;                                    number then some children will be created.
  87. ;             pm.max_spare_servers - the maximum number of children in 'idle'
  88. ;                                    state (waiting to process). If the number
  89. ;                                    of 'idle' processes is greater than this
  90. ;                                    number then some children will be killed.
  91. ;             pm.max_spawn_rate    - the maximum number of rate to spawn child
  92. ;                                    processes at once.
  93. ;  ondemand - no children are created at startup. Children will be forked when
  94. ;             new requests will connect. The following parameter are used:
  95. ;             pm.max_children           - the maximum number of children that
  96. ;                                         can be alive at the same time.
  97. ;             pm.process_idle_timeout   - The number of seconds after which
  98. ;                                         an idle process will be killed.
  99. ; Note: This value is mandatory.
  100. pm = dynamic
  101.  
  102. ; The number of child processes to be created when pm is set to 'static' and the
  103. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  104. ; This value sets the limit on the number of simultaneous requests that will be
  105. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  106. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  107. ; CGI. The below defaults are based on a server without much resources. Don't
  108. ; forget to tweak pm.* to fit your needs.
  109. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
  110. ; Note: This value is mandatory.
  111. pm.max_children = 5
  112.  
  113. ; The number of child processes created on startup.
  114. ; Note: Used only when pm is set to 'dynamic'
  115. ; Default Value: (min_spare_servers + max_spare_servers) / 2
  116. pm.start_servers = 2
  117.  
  118. ; The desired minimum number of idle server processes.
  119. ; Note: Used only when pm is set to 'dynamic'
  120. ; Note: Mandatory when pm is set to 'dynamic'
  121. pm.min_spare_servers = 1
  122.  
  123. ; The desired maximum number of idle server processes.
  124. ; Note: Used only when pm is set to 'dynamic'
  125. ; Note: Mandatory when pm is set to 'dynamic'
  126. pm.max_spare_servers = 3
  127.  
  128. ; The number of rate to spawn child processes at once.
  129. ; Note: Used only when pm is set to 'dynamic'
  130. ; Note: Mandatory when pm is set to 'dynamic'
  131. ; Default Value: 32
  132. ;pm.max_spawn_rate = 32
  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 information:
  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. ;   ************************
  182. ;   pid:                  31330
  183. ;   state:                Running
  184. ;   start time:           01/Jul/2011:17:53:49 +0200
  185. ;   start since:          63087
  186. ;   requests:             12808
  187. ;   request duration:     1250261
  188. ;   request method:       GET
  189. ;   request URI:          /test_mem.php?N=10000
  190. ;   content length:       0
  191. ;   user:                 -
  192. ;   script:               /home/fat/web/docs/php/test_mem.php
  193. ;   last request cpu:     0.00
  194. ;   last request memory:  0
  195. ;
  196. ; Note: There is a real-time FPM status monitoring sample web page available
  197. ;       It's available in: /usr/share/php/fpm/status.html
  198. ;
  199. ; Note: The value must start with a leading slash (/). The value can be
  200. ;       anything, but it may not be a good idea to use the .php extension or it
  201. ;       may conflict with a real PHP file.
  202. ; Default Value: not set
  203. ;pm.status_path = /status
  204.  
  205. ; The address on which to accept FastCGI status request. This creates a new
  206. ; invisible pool that can handle requests independently. This is useful
  207. ; if the main pool is busy with long running requests because it is still possible
  208. ; to get the status before finishing the long running requests.
  209. ;
  210. ; Valid syntaxes are:
  211. ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
  212. ;                            a specific port;
  213. ;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  214. ;                            a specific port;
  215. ;   'port'                 - to listen on a TCP socket to all addresses
  216. ;                            (IPv6 and IPv4-mapped) on a specific port;
  217. ;   '/path/to/unix/socket' - to listen on a unix socket.
  218. ; Default Value: value of the listen option
  219. ;pm.status_listen = 127.0.0.1:9001
  220.  
  221. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  222. ; URI will be recognized as a ping page. This could be used to test from outside
  223. ; that FPM is alive and responding, or to
  224. ; - create a graph of FPM availability (rrd or such);
  225. ; - remove a server from a group if it is not responding (load balancing);
  226. ; - trigger alerts for the operating team (24/7).
  227. ; Note: The value must start with a leading slash (/). The value can be
  228. ;       anything, but it may not be a good idea to use the .php extension or it
  229. ;       may conflict with a real PHP file.
  230. ; Default Value: not set
  231. ;ping.path = /ping
  232.  
  233. ; This directive may be used to customize the response of a ping request. The
  234. ; response is formatted as text/plain with a 200 response code.
  235. ; Default Value: pong
  236. ;ping.response = pong
  237.  
  238. ; The access log file
  239. ; Default: not set
  240. ;access.log = log/$pool.access.log
  241. access.log = /var/log/php-fpm/access/$pool.log
  242.  
  243. ; The access log format.
  244. ; The following syntax is allowed
  245. ;  %%: the '%' character
  246. ;  %C: %CPU used by the request
  247. ;      it can accept the following format:
  248. ;      - %{user}C for user CPU only
  249. ;      - %{system}C for system CPU only
  250. ;      - %{total}C  for user + system CPU (default)
  251. ;  %d: time taken to serve the request
  252. ;      it can accept the following format:
  253. ;      - %{seconds}d (default)
  254. ;      - %{milliseconds}d
  255. ;      - %{milli}d
  256. ;      - %{microseconds}d
  257. ;      - %{micro}d
  258. ;  %e: an environment variable (same as $_ENV or $_SERVER)
  259. ;      it must be associated with embraces to specify the name of the env
  260. ;      variable. Some examples:
  261. ;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
  262. ;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
  263. ;  %f: script filename
  264. ;  %l: content-length of the request (for POST request only)
  265. ;  %m: request method
  266. ;  %M: peak of memory allocated by PHP
  267. ;      it can accept the following format:
  268. ;      - %{bytes}M (default)
  269. ;      - %{kilobytes}M
  270. ;      - %{kilo}M
  271. ;      - %{megabytes}M
  272. ;      - %{mega}M
  273. ;  %n: pool name
  274. ;  %o: output header
  275. ;      it must be associated with embraces to specify the name of the header:
  276. ;      - %{Content-Type}o
  277. ;      - %{X-Powered-By}o
  278. ;      - %{Transfert-Encoding}o
  279. ;      - ....
  280. ;  %p: PID of the child that serviced the request
  281. ;  %P: PID of the parent of the child that serviced the request
  282. ;  %q: the query string
  283. ;  %Q: the '?' character if query string exists
  284. ;  %r: the request URI (without the query string, see %q and %Q)
  285. ;  %R: remote IP address
  286. ;  %s: status (response code)
  287. ;  %t: server time the request was received
  288. ;      it can accept a strftime(3) format:
  289. ;      %d/%b/%Y:%H:%M:%S %z (default)
  290. ;      The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
  291. ;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
  292. ;  %T: time the log has been written (the request has finished)
  293. ;      it can accept a strftime(3) format:
  294. ;      %d/%b/%Y:%H:%M:%S %z (default)
  295. ;      The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
  296. ;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
  297. ;  %u: remote user
  298. ;
  299. ; Default: "%R - %u %t \"%m %r\" %s"
  300. ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
  301. access.format = "%{%Y-%m-%dT%H:%M:%S%z}t %R: \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
  302.  
  303. ; The log file for slow requests
  304. ; Default Value: not set
  305. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  306. ;slowlog = log/$pool.log.slow
  307.  
  308. ; The timeout for serving a single request after which a PHP backtrace will be
  309. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  310. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  311. ; Default Value: 0
  312. ;request_slowlog_timeout = 0
  313.  
  314. ; Depth of slow log stack trace.
  315. ; Default Value: 20
  316. ;request_slowlog_trace_depth = 20
  317.  
  318. ; The timeout for serving a single request after which the worker process will
  319. ; be killed. This option should be used when the 'max_execution_time' ini option
  320. ; does not stop script execution for some reason. A value of '0' means 'off'.
  321. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  322. ; Default Value: 0
  323. ;request_terminate_timeout = 0
  324.  
  325. ; The timeout set by 'request_terminate_timeout' ini option is not engaged after
  326. ; application calls 'fastcgi_finish_request' or when application has finished and
  327. ; shutdown functions are being called (registered via register_shutdown_function).
  328. ; This option will enable timeout limit to be applied unconditionally
  329. ; even in such cases.
  330. ; Default Value: no
  331. ;request_terminate_timeout_track_finished = no
  332.  
  333. ; Set open file descriptor rlimit.
  334. ; Default Value: system defined value
  335. ;rlimit_files = 1024
  336.  
  337. ; Set max core size rlimit.
  338. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  339. ; Default Value: system defined value
  340. ;rlimit_core = 0
  341.  
  342. ; Chroot to this directory at the start. This value must be defined as an
  343. ; absolute path. When this value is not set, chroot is not used.
  344. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  345. ; of its subdirectories. If the pool prefix is not set, the global prefix
  346. ; will be used instead.
  347. ; Note: chrooting is a great security feature and should be used whenever
  348. ;       possible. However, all PHP paths will be relative to the chroot
  349. ;       (error_log, sessions.save_path, ...).
  350. ; Default Value: not set
  351. ;chroot =
  352.  
  353. ; Chdir to this directory at the start.
  354. ; Note: relative path can be used.
  355. ; Default Value: current directory or / when chroot
  356. ;chdir = /srv/http
  357. chdir = /usr/share/webapps/$pool
  358.  
  359. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  360. ; stderr will be redirected to /dev/null according to FastCGI specs.
  361. ; Note: on highloaded environment, this can cause some delay in the page
  362. ; process time (several ms).
  363. ; Default Value: no
  364. ;catch_workers_output = yes
  365.  
  366. ; Decorate worker output with prefix and suffix containing information about
  367. ; the child that writes to the log and if stdout or stderr is used as well as
  368. ; log level and time. This options is used only if catch_workers_output is yes.
  369. ; Settings to "no" will output data as written to the stdout or stderr.
  370. ; Default value: yes
  371. ;decorate_workers_output = no
  372.  
  373. ; Clear environment in FPM workers
  374. ; Prevents arbitrary environment variables from reaching FPM worker processes
  375. ; by clearing the environment in workers before env vars specified in this
  376. ; pool configuration are added.
  377. ; Setting to "no" will make all environment variables available to PHP code
  378. ; via getenv(), $_ENV and $_SERVER.
  379. ; Default Value: yes
  380. ;clear_env = no
  381.  
  382. ; Limits the extensions of the main script FPM will allow to parse. This can
  383. ; prevent configuration mistakes on the web server side. You should only limit
  384. ; FPM to .php extensions to prevent malicious users to use other extensions to
  385. ; execute php code.
  386. ; Note: set an empty value to allow all extensions.
  387. ; Default Value: .php
  388. ;security.limit_extensions = .php .php3 .php4 .php5 .php7
  389.  
  390. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  391. ; the current environment.
  392. ; Default Value: clean env
  393. env[HOSTNAME] = $HOSTNAME
  394. env[PATH] = /usr/local/bin:/usr/bin
  395. env[TMP] = /tmp
  396. env[TMPDIR] = /tmp
  397. env[TEMP] = /tmp
  398.  
  399. ; Additional php.ini defines, specific to this pool of workers. These settings
  400. ; overwrite the values previously defined in the php.ini. The directives are the
  401. ; same as the PHP SAPI:
  402. ;   php_value/php_flag             - you can set classic ini defines which can
  403. ;                                    be overwritten from PHP call 'ini_set'.
  404. ;   php_admin_value/php_admin_flag - these directives won't be overwritten by
  405. ;                                     PHP call 'ini_set'
  406. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  407.  
  408. ; Defining 'extension' will load the corresponding shared extension from
  409. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  410. ; overwrite previously defined php.ini values, but will append the new value
  411. ; instead.
  412.  
  413. ; Note: path INI options can be relative and will be expanded with the prefix
  414. ; (pool, global or /usr)
  415.  
  416. ; Default Value: nothing is defined by default except the values in php.ini and
  417. ;                specified at startup with the -d argument
  418. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  419. ;php_flag[display_errors] = off
  420. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  421. ;php_admin_flag[log_errors] = on
  422. ;php_admin_value[memory_limit] = 32M
  423.  
  424. php_value[date.timezone] = Europe/Berlin
  425.  
  426. php_value[open_basedir] = /var/lib/$pool:/tmp:/usr/share/webapps/$pool:/etc/webapps/$pool:/dev/urandom:/usr/lib/php/modules:/var/log/$pool:/proc/meminfo
  427.  
  428. ; put session data in dedicated directory
  429. php_value[session.save_path] = /var/lib/$pool/sessions
  430. php_value[session.gc_maxlifetime] = 21600
  431. php_value[session.gc_divisor] = 500
  432. php_value[session.gc_probability] = 1
  433.  
  434. php_flag[expose_php] = false
  435. php_value[post_max_size] = 1000M
  436. php_value[upload_max_filesize] = 1000M
  437.  
  438. ; as recommended in admin manual (avoids related warning in admin GUI later)
  439. php_flag[output_buffering] = off
  440. php_value[max_input_time] = 120
  441. php_value[max_execution_time] = 60
  442.  
  443. php_value[memory_limit] = 768M
  444.  
  445. ; opcache settings must be defined in php-fpm.ini. otherwise (i.e. when defined here)
  446. ; this causes segmentation faults in php-fpm worker processes
  447.  
  448. ; uncomment if php-apcu is installed and used
  449. ; php_value[extension] = apcu
  450. ; (see https://github.com/krakjoe/apcu/blob/simplify/INSTALL)
  451. php_value[apc.ttl] = 7200
  452. php_flag[apc.enable_cli] = 1
  453.  
  454. php_value[extension] = bcmath
  455. php_value[extension] = bz2
  456. php_value[extension] = exif
  457. php_value[extension] = gd
  458. php_value[extension] = gmp
  459. ; uncomment if php-imagick is installed and used
  460. php_value[extension] = imagick
  461. ; uncomment if php-imap is installed and used
  462. ; php_value[extension] = imap
  463. ; recommended to enable
  464. php_value[extension] = intl
  465. php_value[extension] = iconv
  466. ; uncomment if php-memcached is installed and used
  467. ; php_value[extension] = memcached
  468. ; uncomment exactly one of the pdo extensions
  469. php_value[extension] = pdo_mysql
  470. ; php_value[extension] = pdo_pgsql
  471. ; php_value[extension] = pdo_sqlite
  472. ; uncomment if php-igbinary is installed and used
  473. ; php_value[extension] = igbinary
  474. ; uncomment if php-redis is installed and used (requires php-igbinary)
  475. ; php_value[extension] = redis
  476. ; uncomment if php-xsl is installed and used
  477. ; php_value[extension] = xsl
Advertisement
RAW Paste Data Copied
Advertisement