Skip to content

Commit

Permalink
fix #70 error: Could not find template icinga/apache_custom_default.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Jan 2, 2023
1 parent f5fe0e7 commit be2bbe3
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 20 deletions.
3 changes: 2 additions & 1 deletion manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
}

$php_extensions = {
process => { ini_prefix => '20-' },
mbstring => { ini_prefix => '20-' },
json => { ini_prefix => '20-' },
ldap => { ini_prefix => '20-' },
Expand Down Expand Up @@ -210,7 +211,7 @@

apache::custom_config { 'icingaweb2':
ensure => present,
content => template('icinga/apache_custom_default.conf'),
content => template('icinga/apache_custom_default.conf.erb'),
verify_config => false,
priority => false,
}
Expand Down
38 changes: 19 additions & 19 deletions manifests/web/director.pp
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# @summary
# Setup Director module for Icinga Web 2
#
# @param [Stdlib::Ensure::Service] service_ensure
# @param service_ensure
# Manages if the Director service should be stopped or running.
#
# @param [Boolean] service_enable
# @param service_enable
# If set to true the Director service will start on boot.
#
# @param [Enum['mysql', 'pgsql']] db_type
# @param db_type
# Type of your database. Either `mysql` or `pgsql`.
#
# @param [Stdlib::Host] db_host
# @param db_host
# Hostname of the database.
#
# @param [Optional[Stdlib::Port]] db_port
# @param db_port
# Port of the database.
#
# @param [String] db_name
# @param db_name
# Name of the database.
#
# @param [String] db_user
# @param db_user
# Username for DB connection.
#
# @param [String] db_pass
# @param db_pass
# Password for DB connection.
#
# @param [String] endpoint
# @param endpoint
# Endpoint object name of Icinga 2 API.
#
# @param [Boolean] manage_database
# @param manage_database
# Create database and import schema.
#
# @param [Stdlib::Host] api_host
# @param api_host
# Icinga 2 API hostname.
#
# @param [String] api_user
# @param api_user
# Icinga 2 API username.
#
# @param [String] api_pass
# @param api_pass
# Icinga 2 API password.
#
class icinga::web::director (
Expand Down Expand Up @@ -71,12 +71,12 @@
#
if $manage_database {
class { 'icinga::web::director::database':
db_type => $db_type,
db_name => $db_name,
db_user => $db_user,
db_pass => $db_pass,
iweb_instances => ['localhost'],
before => Class['icingaweb2::module::director'],
db_type => $db_type,
db_name => $db_name,
db_user => $db_user,
db_pass => $db_pass,
web_instances => ['localhost'],
before => Class['icingaweb2::module::director'],
}
$_db_host = 'localhost'
} else {
Expand Down
49 changes: 49 additions & 0 deletions templates/apache_custom_default.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Alias /icingaweb2 "/usr/share/icingaweb2/public"

<Directory "/usr/share/icingaweb2/public">
Options SymLinksIfOwnerMatch
AllowOverride None

DirectoryIndex index.php

<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 "/etc/icingaweb2"

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
# remove comments if you want to use FPM
<FilesMatch "\.php$">
<% if @apache_cgi_pass_auth -%> CGIPassAuth on
<% end -%>
SetHandler "proxy:fcgi://127.0.0.1:9000"
ErrorDocument 503 /icingaweb2/error_unavailable.html
</FilesMatch>
</Directory>

0 comments on commit be2bbe3

Please sign in to comment.