diff --git a/apache/handlers/main.yml b/apache/handlers/main.yml
index af4d94d2..96daa368 100644
--- a/apache/handlers/main.yml
+++ b/apache/handlers/main.yml
@@ -8,3 +8,8 @@
service:
name: apache2
state: reloaded
+
+- name: restart munin-node
+ service:
+ name: munin-node
+ state: restarted
diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml
index a6a46eb8..2325ba4c 100644
--- a/apache/tasks/main.yml
+++ b/apache/tasks/main.yml
@@ -209,6 +209,16 @@
- include: phpmyadmin.yml
when: _default_index.stat.exists
+- name: Check if Munin plugins exists
+ stat:
+ path: /etc/munin/plugins/
+ register: _munin_plugins
+ check_mode: no
+ tags:
+ - apache
+
+- include: munin.yml
+ when: _munin_plugins.stat.exists
# - block:
# - name: generate random string for serverstatus suffix
diff --git a/apache/tasks/munin.yml b/apache/tasks/munin.yml
new file mode 100644
index 00000000..ce560868
--- /dev/null
+++ b/apache/tasks/munin.yml
@@ -0,0 +1,24 @@
+---
+
+- name: install packages for Apache and Munin
+ apt:
+ name: libapache2-mod-fcgid
+ state: installed
+ notify: reload apache
+ tags:
+ - apache
+ - munin
+
+- name: install munin plugins
+ file:
+ src: "/etc/munin/plugins/{{ item }}"
+ dest: "/usr/share/munin/plugins/{{ item }}"
+ state: link
+ with_items:
+ - apache_accesses
+ - apache_processes
+ - apache_volume
+ notify: restart munin-node
+ tags:
+ - apache
+ - munin
diff --git a/apache/templates/evolinux-default.conf.j2 b/apache/templates/evolinux-default.conf.j2
index 38a367d4..36ae65ad 100644
--- a/apache/templates/evolinux-default.conf.j2
+++ b/apache/templates/evolinux-default.conf.j2
@@ -53,6 +53,25 @@
Include /etc/apache2/private_ipaddr_whitelist.conf
+ # Munin cgi
+ # Ensure we can run (fast)cgi scripts
+ ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
+
+ Options +ExecCGI
+
+ SetHandler fcgid-script
+
+
+ SetHandler fastcgi-script
+
+
+
+ SetHandler cgi-script
+
+
+ Allow from all
+
+
# For CGI Scripts. We need to set Directory directive as ScriptAlias take precedence.
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/