Commit 9bc75a80 authored by Markus Frosch's avatar Markus Frosch 📣
Browse files

icingaweb2: Manage fpm on CentOS

parent de095650
Pipeline #807 failed with stage
in 46 seconds
......@@ -4,6 +4,26 @@ class icinga2_testing::profiles::icingaweb2 {
if $::operatingsystem == 'CentOS' {
ensure_packages(['centos-release-scl'])
Package['centos-release-scl'] -> Class['::icingaweb2']
$_use_fpm = true
$_fpm_service = 'rh-php71-php-fpm'
} else {
$_use_fpm = false
}
if $_use_fpm {
# TODO: improve FPM handling
service { 'php-fpm':
ensure => running,
enable => true,
name => $_fpm_service,
require => Package['icingaweb2'],
}
}
include ::apache
::apache::custom_config { 'icingaweb2':
content => template($::icingaweb2::template_apache),
}
class { '::icingaweb2':
......
###################################################################
# #
# WARNING: This config file is automatically generated by Puppet. #
# ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! #
# #
###################################################################
Alias /icingaweb2 "<%= @web_root %>/public"
<Directory "<%= @web_root %>/public">
Options SymLinksIfOwnerMatch
AllowOverride None
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require all granted
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
</IfModule>
SetEnv ICINGAWEB_CONFIGDIR "<%= @config_dir %>"
EnableSendfile Off
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /icingaweb2/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
<IfModule !mod_rewrite.c>
DirectoryIndex error_norewrite.html
ErrorDocument 404 /icingaweb2/error_norewrite.html
</IfModule>
# forwarding PHP requests to FPM
<%- if @_use_fpm -%>
# forwarding PHP requests to FPM
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9000"
ErrorDocument 503 /icingaweb2/error_unavailable.html
</FilesMatch>
<%- else -%>
# remove comments if you want to use FPM
#<FilesMatch "\.php$">
# SetHandler "proxy:fcgi://127.0.0.1:9000"
# ErrorDocument 503 /icingaweb2/error_unavailable.html
#</FilesMatch>
<%- end -%>
</Directory>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment