Mercurial > repos > other > Puppet
annotate modules/website/manifests/php.pp @ 433:e7491c126d95
Set filename on php.conf
This _should_ prevent PHP exploding every time our PHP package
updates and it recreates the default config file.
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 21 Feb 2023 15:56:26 +0000 |
parents | 3744cd0807cb |
children | 6293839019d0 |
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 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
46 'PHP/upload_max_filesize' => "8M", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
47 'PHP/post_max_size' => "8M", |
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 }, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
50 extensions => { |
425
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
51 ctype => { |
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
52 ini_prefix => '20-', |
b91e948e8645
Add another PHP module to fix webmail
IBBoard <dev@ibboard.co.uk>
parents:
422
diff
changeset
|
53 }, |
422 | 54 gd => { |
55 ini_prefix => '20-', | |
56 }, | |
57 iconv => { | |
58 ini_prefix => '20-', | |
59 }, | |
60 mbstring => { | |
61 ini_prefix => '20-', | |
62 }, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
63 opcache => { |
422 | 64 ini_prefix => '10-', |
65 zend => true, | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
66 settings => { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
67 'opcache.enable' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
68 'opcache.enable_cli' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
69 'opcache.interned_strings_buffer' => 8, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
70 'opcache.max_accelerated_files' => 10000, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
71 'opcache.memory_consumption' => 128, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
72 'opcache.save_comments' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
73 'opcache.revalidate_freq' => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
74 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
75 }, |
422 | 76 xml => { |
77 ini_prefix => '20-', | |
78 }, | |
399
2c6065b5be5e
Switch to config-based PHP extensions
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
79 } + $extras, |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
80 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
81 apache::custom_config { "php.conf": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
82 ensure => present, |
433 | 83 source => "puppet:///modules/website/php.conf", |
84 filename => "php.conf", | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
85 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
357
diff
changeset
|
86 class { ['apache::mod::proxy', 'apache::mod::proxy_fcgi']:} |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
87 } |