Mercurial > repos > other > Puppet
annotate modules/website/manifests/php.pp @ 444:83fbddb56de1
Increase PHP limits
Required to install/upgrade NextCloud on the test VPS.
Servers are bigger now, so it should be okay
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 08 May 2023 13:41:26 +0100 |
parents | 6293839019d0 |
children | d0e7979c7e8c |
rev | line source |
---|---|
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 class website::php( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 $suffix = '', |
320 | 3 $module = undef, |
69
565b788f7ac1
Allow for specifying extra PHP packages (e.g. to enable Posix)
IBBoard <dev@ibboard.co.uk>
parents:
17
diff
changeset
|
4 $extras = [], |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 ) { |
402 | 6 include ::apache::params |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
7 if $osfamily == 'RedHat' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
8 # Work around SELinux "denied execmem" warnings from preg_match JITing |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
9 $pcre_jit = 0 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
10 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
11 else { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
12 $pcre_jit = 1 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
13 } |
419 | 14 |
15 file { '/run/php/': | |
16 ensure => directory, | |
17 } -> | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
18 class { '::php': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
19 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
20 manage_repos => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
21 fpm => true, |
419 | 22 fpm_service_enable => true, |
23 fpm_service_ensure => 'running', | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
24 fpm_pools => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
25 'www' => { |
427 | 26 'listen' => '/run/php-fpm.sock', |
402 | 27 'listen_owner' => $::apache::params::user, |
28 'listen_group' => $::apache::params::group, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
29 'slowlog' => '/var/log/php-fpm/www-slow.log', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
30 'security_limit_extensions' => ['.php', '.html'], |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
31 'php_admin_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
32 'memory_limit' => '256M', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
33 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
34 'php_value' => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
35 # 'session.save_path' => '/var/lib/php/session' # Ubuntu uses plural, CentOS uses singular |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
36 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
37 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
38 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
39 dev => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
40 composer => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
41 pear => false, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
42 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
43 'PHP/default_charset' => 'UTF-8', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
44 'PHP/pcre.jit' => $pcre_jit, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
45 # Space isn't scarce these days - increase default sizes |
444 | 46 'PHP/upload_max_filesize' => "16M", |
47 'PHP/post_max_size' => "16M", | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
48 'Data/date.timezone' => 'UTC', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
49 }, |
436
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
50 cli_settings => { |
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
51 'apc.enable_cli' => 1 , |
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
52 }, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
53 extensions => { |
425
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
54 ctype => { |
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
55 ini_prefix => '20-', |
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
56 }, |
422 | 57 gd => { |
58 ini_prefix => '20-', | |
59 }, | |
60 iconv => { | |
61 ini_prefix => '20-', | |
62 }, | |
63 mbstring => { | |
64 ini_prefix => '20-', | |
65 }, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
66 opcache => { |
444 | 67 ensure => present, |
422 | 68 ini_prefix => '10-', |
69 zend => true, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
70 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
71 'opcache.enable' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
72 'opcache.enable_cli' => 1, |
436
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
73 'opcache.interned_strings_buffer' => 16, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
74 'opcache.max_accelerated_files' => 10000, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
75 'opcache.memory_consumption' => 128, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
76 'opcache.save_comments' => 1, |
436
6293839019d0
Adjust PHP settings for NextCloud
IBBoard <dev@ibboard.co.uk>
parents:
433
diff
changeset
|
77 'opcache.revalidate_freq' => 60, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
78 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
79 }, |
422 | 80 xml => { |
81 ini_prefix => '20-', | |
82 }, | |
399
2c6065b5be5e
Switch to config-based PHP extensions
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
83 } + $extras, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
84 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
85 apache::custom_config { "php.conf": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
86 ensure => present, |
433 | 87 source => "puppet:///modules/website/php.conf", |
88 filename => "php.conf", | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
89 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
90 class { ['apache::mod::proxy', 'apache::mod::proxy_fcgi']:} |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
91 } |