From 90d641f3171253523959e2e194e7cea05e9b2d28 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 26 Feb 2026 12:15:03 -0500 Subject: [PATCH] Automatically a2enmod rewrite --- distros/ubuntu2004/zoneminder.postinst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/distros/ubuntu2004/zoneminder.postinst b/distros/ubuntu2004/zoneminder.postinst index 725e184b4..7dd06daec 100644 --- a/distros/ubuntu2004/zoneminder.postinst +++ b/distros/ubuntu2004/zoneminder.postinst @@ -82,6 +82,14 @@ if [ "$1" = "configure" ]; then fi fi + if [ ! -e "/etc/apache2/mods-enabled/rewrite.load" ] && [ "$(command -v a2enmod)" != "" ]; then + echo "The rewrite module is not enabled in apache2. I am enabling it using a2enmod rewrite." + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke rewrite cgi || exit $? + fi + fi + SYSTEMD=0 if [ -e "/run/systemd/system" ]; then SYSTEMD=1