apache: enable Munin plugins and CGI mode
This commit is contained in:
parent
af1045d788
commit
3e1a600fd5
|
@ -8,3 +8,8 @@
|
||||||
service:
|
service:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
|
- name: restart munin-node
|
||||||
|
service:
|
||||||
|
name: munin-node
|
||||||
|
state: restarted
|
||||||
|
|
|
@ -209,6 +209,16 @@
|
||||||
- include: phpmyadmin.yml
|
- include: phpmyadmin.yml
|
||||||
when: _default_index.stat.exists
|
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:
|
# - block:
|
||||||
# - name: generate random string for serverstatus suffix
|
# - name: generate random string for serverstatus suffix
|
||||||
|
|
24
apache/tasks/munin.yml
Normal file
24
apache/tasks/munin.yml
Normal file
|
@ -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
|
|
@ -53,6 +53,25 @@
|
||||||
Include /etc/apache2/private_ipaddr_whitelist.conf
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
# Munin cgi
|
||||||
|
# Ensure we can run (fast)cgi scripts
|
||||||
|
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
|
||||||
|
<Location /munin-cgi/munin-cgi-graph>
|
||||||
|
Options +ExecCGI
|
||||||
|
<IfModule mod_fcgid.c>
|
||||||
|
SetHandler fcgid-script
|
||||||
|
</IfModule>
|
||||||
|
<IfModule mod_fastcgi.c>
|
||||||
|
SetHandler fastcgi-script
|
||||||
|
</IfModule>
|
||||||
|
<IfModule !mod_fastcgi.c>
|
||||||
|
<IfModule !mod_fcgid.c>
|
||||||
|
SetHandler cgi-script
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
Allow from all
|
||||||
|
</Location>
|
||||||
|
|
||||||
# For CGI Scripts. We need to set Directory directive as ScriptAlias take precedence.
|
# For CGI Scripts. We need to set Directory directive as ScriptAlias take precedence.
|
||||||
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
||||||
<Directory /usr/lib/cgi-bin>
|
<Directory /usr/lib/cgi-bin>
|
||||||
|
|
Loading…
Reference in a new issue