Puppet Class: profile::piwik::webserver

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

Overview

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.

Parameters:

  • prometheus_nodes (Any) (defaults to: hiera('prometheus_nodes'))


9
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
# File 'modules/profile/manifests/piwik/webserver.pp', line 9

class profile::piwik::webserver(
    $prometheus_nodes = hiera('prometheus_nodes')
){
    include ::profile::prometheus::apache_exporter

    $php_module = 'php7.3'
    $php_ini = '/etc/php/7.3/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',
    }

    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'],
    }
}