xymon/manifests/server/apache.pp

90 lines
5.2 KiB
Puppet

# == Class: xymon::server::apache
#
# Manage Apache2 configuration and vhost for Xymon
#
class xymon::server::apache {
if (! defined(Class['::apache'])) and ($xymon::server::manage_apache_conf == true) {
include apache::mod::rewrite
class { '::apache':
mpm_module => 'prefork',
default_vhost => false,
}
}
if ($xymon::server::manage_apache_vhost == true) {
apache::vhost { 'xymon':
servername => $::fqdn,
port => 80,
docroot => '/var/lib/xymon/www',
directories => [
{ path => '/var/lib/xymon/www',
options => ['Indexes','FollowSymLinks','Includes','MultiViews'],
},
{ path => '/usr/lib/xymon/cgi-bin',
allow_override => ['None'],
options => ['ExecCGI','Includes'],
},
{ path => '/usr/lib/xymon/cgi-secure',
allow_override => ['None'],
options => ['ExecCGI','Includes'],
auth_user_file => '/etc/xymon/xymonpasswd',
auth_group_file => '/etc/xymon/xymongroups',
auth_type => 'Basic',
auth_name => 'Xymon Administration',
auth_require => 'valid-user',
},
],
priority => '10',
aliases => [
{ alias => '/xymon/',
path => '/var/lib/xymon/www/',
},
{ scriptalias => '/xymon-cgi/',
path => '/usr/lib/xymon/cgi-bin/',
},
{ scriptalias => '/xymon-seccgi/',
path => '/usr/lib/xymon/cgi-secure/',
},
],
rewrites => [
{ rewrite_rule => ['^/xymon/bb2.html /xymon/nongreen.html [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon/bbnk.html /xymon/critical.html [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-hist.sh /xymon-cgi/history.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-eventlog.sh /xymon-cgi/eventlog.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-rep.sh /xymon-cgi/report.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-replog.sh /xymon-cgi/reportlog.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-snapshot.sh /xymon-cgi/snapshot.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-findhost.sh /xymon-cgi/findhost.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-csvinfo.sh /xymon-cgi/csvinfo.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbitcolumn.sh /xymon-cgi/columndoc.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-datepage.sh /xymon-cgi/datepage.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbitgraph.sh /xymon-cgi/showgraph.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-hostsvc.sh /xymon-cgi/svcstatus.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/bb-histlog.sh /xymon-cgi/historylog.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-confreport.sh /xymon-cgi/confreport.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-confreport-critical.sh /xymon-cgi/confreport-critical.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-nkview.sh /xymon-cgi/criticalview.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-certreport.sh /xymon-cgi/certreport.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-nongreen.sh /xymon-cgi/nongreen.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-hostgraphs.sh /xymon-cgi/hostgraphs.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-ghosts.sh /xymon-cgi/ghostlist.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-notifylog.sh /xymon-cgi/notifications.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-hostlist.sh /xymon-cgi/hostlist.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-perfdata.sh /xymon-cgi/perfdata.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-cgi/hobbit-topchanges.sh /xymon-cgi/topchanges.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-seccgi/bb-ack.sh /xymon-seccgi/acknowledge.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-seccgi/hobbit-enadis.sh /xymon-seccgi/enadis.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-seccgi/hobbit-nkedit.sh /xymon-seccgi/criticaleditor.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-seccgi/hobbit-ackinfo.sh /xymon-seccgi/ackinfo.sh [R=permanent,L]'], },
{ rewrite_rule => ['^/xymon-seccgi/hobbit-useradm.sh /xymon-seccgi/useradm.sh [R=permanent,L]'], },
],
access_log_syslog => '|/usr/bin/tee -a /var/log/apache2/defaults_access.log | /usr/bin/logger -thttpd -plocal1.notice',
error_log_syslog => '|/usr/bin/tee -a /var/log/apache2/defaults_error.log | /usr/bin/logger -thttpd -plocal1.notice',
}
}
} # Private class: xymon::server::apache