From 92ca77f5037f93987d7be76a301e78b34d4d59e2 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 10 Jun 2023 23:34:23 +0200 Subject: [PATCH] Watch apache log for open_basedir messages --- templates/monit.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/monit.j2 b/templates/monit.j2 index f813427..3181ece 100644 --- a/templates/monit.j2 +++ b/templates/monit.j2 @@ -6,3 +6,8 @@ check process php-fpm with pidfile /run/php/php{{ php_version.stdout }}-fpm.pid stop program = "/usr/sbin/service php{{ php_version.stdout }}-fpm stop" if failed unixsocket /run/php/php{{ php_version.stdout }}-fpm.sock for 3 cycles then restart if 3 restarts within 5 cycles then timeout + +{% if apache2 in ansible_facts.packages %} +check file basedir with path /var/log/apache2/error.log + if match "open_basedir restriction in effect" then alert +{% endif %}