From bcc6496b060e594843dc8cd61f3e1013acc4edce Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Fri, 16 Oct 2009 21:15:25 +0100 Subject: [PATCH] apache hosts load mod info and status, and serve it Signed-off-by: Stephen Gran --- .../etc/apache2/conf.d/local-serverinfo | 14 ++++++++++++++ .../common/etc/apache2/conf.d/server-status | 19 +++++++++++++++++++ modules/apache2/manifests/init.pp | 18 ++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 modules/apache2/files/common/etc/apache2/conf.d/local-serverinfo create mode 100644 modules/apache2/files/common/etc/apache2/conf.d/server-status diff --git a/modules/apache2/files/common/etc/apache2/conf.d/local-serverinfo b/modules/apache2/files/common/etc/apache2/conf.d/local-serverinfo new file mode 100644 index 00000000..cd52b7a9 --- /dev/null +++ b/modules/apache2/files/common/etc/apache2/conf.d/local-serverinfo @@ -0,0 +1,14 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## + + + + SetHandler server-info + order deny,allow + deny from all + allow from localhost + + + diff --git a/modules/apache2/files/common/etc/apache2/conf.d/server-status b/modules/apache2/files/common/etc/apache2/conf.d/server-status new file mode 100644 index 00000000..3e25f8a7 --- /dev/null +++ b/modules/apache2/files/common/etc/apache2/conf.d/server-status @@ -0,0 +1,19 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## + + + # + # Allow server status reports generated by mod_status, + # with the URL of http://servername/server-status + # Change the ".example.com" to match your domain to enable. + # + ExtendedStatus on + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + diff --git a/modules/apache2/manifests/init.pp b/modules/apache2/manifests/init.pp index 0e74f7b1..633a4732 100644 --- a/modules/apache2/manifests/init.pp +++ b/modules/apache2/manifests/init.pp @@ -1,9 +1,18 @@ +define enable_module($module) { + exec { "/usr/sbin/a2enmod $module": } +} + class apache2 { package { apache2: ensure => installed; logrotate: ensure => installed; } + enable_module { + "info": module => info; + "status": module => status; + } + file { "/etc/apache2/conf.d/ressource-limits": content => template("apache2/ressource-limits.erb"), @@ -14,6 +23,15 @@ class apache2 { "puppet:///apache2/common/etc/apache2/conf.d/security" ], require => Package["apache2"], notify => Exec["apache2 reload"]; + "/etc/apache2/conf.d/local-serverinfo": + source => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/local-serverinfo", + "puppet:///apache2/common/etc/apache2/conf.d/local-serverinfo" ], + require => Package["apache2"], + "/etc/apache2/conf.d/server-status": + source => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/server-status", + "puppet:///apache2/common/etc/apache2/conf.d/server-status" ], + require => Package["apache2"], + notify => Exec["apache2 reload"]; "/etc/apache2/sites-available/default-debian.org": source => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/sites-available/default-debian.org", -- 2.39.2