Puppet Class: profile::piwik::webserver

Defined in:
modules/profile/manifests/piwik/webserver.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class: profile::piwik::webserver

Apache webserver instance configured with mpm-prefork and mod_php. This configuration should be improved with something more up to date like mpm-event and php-fpm/hhmv. Piwik has been rebranded to 'Matomo', but to avoid too many changes we are going to just keep the previous name.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'modules/profile/manifests/piwik/webserver.pp', line 10

class profile::piwik::webserver {
    include profile::prometheus::apache_exporter

    $php_version = wmflib::debian_php_version()
    $php_module = "php${php_version}"
    $php_ini = "/etc/php/${php_version}/apache2/php.ini"

    package { "${php_module}-mbstring":
        ensure => 'present',
    }
    package { "${php_module}-xml":
        ensure => 'present',
    }

    package { "libapache2-mod-${php_module}":
        ensure => 'present',
    }

    class { 'httpd':
        modules => ['headers', $php_module, 'rewrite'],
        require => Package["libapache2-mod-${php_module}"],
    }

    class { 'httpd::mpm':
        mpm    => 'prefork',
        source => 'puppet:///modules/profile/piwik/mpm_prefork.conf',
    }

    profile::auto_restarts::service { 'apache2': }
    profile::auto_restarts::service { 'envoyproxy': }

    require profile::analytics::httpd::utils
    include profile::idp::client::httpd

    file_line { 'enable_php_opcache':
        line   => 'opcache.enable=1',
        match  => '^;?opcache.enable\s*\=',
        path   => $php_ini,
        notify => Class['::httpd'],
    }

    file_line { 'php_memory_limit':
        line   => 'memory_limit = 256M',
        match  => '^;?memory_limit\s*\=',
        path   => $php_ini,
        notify => Class['::httpd'],
    }
}