From 0128d6e20c8ebf26aff6f3b0bbc629d2ff0093da Mon Sep 17 00:00:00 2001 From: ju5t Date: Sun, 29 Mar 2015 09:55:11 +0200 Subject: [PATCH 1/2] bugfix for vhosts in apache 2.4 --- manifests/web.pp | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/manifests/web.pp b/manifests/web.pp index b01c5a60e..59f18e1a4 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -250,36 +250,25 @@ $apache_listen_port = '80' } + # Check which version of Apache we're using + if versioncmp($::apache::apache_version, '2.4') >= 0 { + $directory_allow = { 'require' => 'all granted', } + $directory_deny = { 'require' => 'all denied', } + } else { + $directory_allow = { 'allow' => 'from all', 'order' => 'Allow,Deny', } + $directory_deny = { 'deny' => 'from all', 'order' => 'Deny,Allow', } + } + apache::vhost { $zabbix_url: - docroot => '/usr/share/zabbix', - port => $apache_listen_port, - directories => [ - { path => '/usr/share/zabbix', - provider => 'directory', - allow => 'from all', - order => 'Allow,Deny', - }, - { path => '/usr/share/zabbix/conf', - provider => 'directory', - deny => 'from all', - order => 'Deny,Allow', - }, - { path => '/usr/share/zabbix/api', - provider => 'directory', - deny => 'from all', - order => 'Deny,Allow', - }, - { path => '/usr/share/zabbix/include', - provider => 'directory', - deny => 'from all', - order => 'Deny,Allow', - }, - { path => '/usr/share/zabbix/include/classes', - provider => 'directory', - deny => 'from all', - order => 'Deny,Allow', - }, - ], + docroot => '/usr/share/zabbix', + port => $apache_listen_port, + directories => [ + merge({ path => '/usr/share/zabbix', provider => 'directory', }, $directory_allow), + merge({ path => '/usr/share/zabbix/conf', provider => 'directory', }, $directory_deny), + merge({ path => '/usr/share/zabbix/api', provider => 'directory', }, $directory_deny), + merge({ path => '/usr/share/zabbix/include', provider => 'directory', }, $directory_deny), + merge({ path => '/usr/share/zabbix/include/classes', provider => 'directory', }, $directory_deny), + , custom_fragment => " php_value max_execution_time 300 php_value memory_limit 128M From bfcbba96935961b0f6e7fad660dd4ced657ca668 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sun, 29 Mar 2015 09:59:46 +0200 Subject: [PATCH 2/2] bugfix for vhosts in apache 2.4 --- manifests/web.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/web.pp b/manifests/web.pp index 59f18e1a4..926f5147d 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -268,7 +268,7 @@ merge({ path => '/usr/share/zabbix/api', provider => 'directory', }, $directory_deny), merge({ path => '/usr/share/zabbix/include', provider => 'directory', }, $directory_deny), merge({ path => '/usr/share/zabbix/include/classes', provider => 'directory', }, $directory_deny), - , + ], custom_fragment => " php_value max_execution_time 300 php_value memory_limit 128M