Browse Source

Merge pull request #323 from philandstuff/monit-apache-fix

Fix monit monitoring for apache
Alex Payne 10 years ago
parent
commit
4e4c8596d3

+ 10
- 0
roles/monitoring/files/etc_apache2_sites-available_00-status.conf View File

@@ -0,0 +1,10 @@
1
+# This needs to be the first configured virtualhost on port 80 so that
2
+# requests to http://localhost hit this rather than any other vhost
3
+<VirtualHost *:80>
4
+  <Location />
5
+    SetHandler server-status
6
+    Order deny,allow
7
+    Deny from all
8
+    Allow from 127.0.0.1
9
+  </Location>
10
+</VirtualHost>

+ 7
- 0
roles/monitoring/tasks/monit.yml View File

@@ -1,3 +1,10 @@
1
+- name: Add monitoring vhost to apache
2
+  copy: src=etc_apache2_sites-available_00-status.conf dest=/etc/apache2/sites-available/00-status.conf
3
+
4
+- name: Enable the status vhost
5
+  command: a2ensite 00-status.conf creates=/etc/apache2/sites-enabled/00-status.conf
6
+  notify: restart apache
7
+
1 8
 - name: Install monit
2 9
   apt: pkg=monit state=installed
3 10
 

Loading…
Cancel
Save