From 7a9ed1cad06cff911c952b32eaf31d0074929f87 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 8 Apr 2025 13:59:02 -0700 Subject: [PATCH] zoph: Don't use mod-php instead continue to use php-fpm Zoph package depends on libapache2-mod-php. This installed and enables mod-php. Also the process model for apache is switched to prefork. In FreedomBox, we want mod-event and php-fpm. So, immediately after installing the package, re-run apache setup to ensure that PHP related changes are undone. Tests: - On Bookworm and Trixie, install zoph. Ensure that 'a2query -m php-8.{2,4}' show that mod-php is disabled. Also 'a2query -m mpm_event' shows it is enabled and prefork is disabled. Apache is restarted during installation. - On Bookworm install without patch and notice that mod-php is installed. Apply patches and notice that mod-php and mpm_prefork are disabled while mpm_event is enabled. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/zoph/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plinth/modules/zoph/__init__.py b/plinth/modules/zoph/__init__.py index 223fefdef..e7e2e0579 100644 --- a/plinth/modules/zoph/__init__.py +++ b/plinth/modules/zoph/__init__.py @@ -9,6 +9,7 @@ from plinth import app as app_module from plinth import cfg, frontpage, menu from plinth.config import DropinConfigs from plinth.daemon import SharedDaemon +from plinth.modules.apache import privileged as apache_privileged from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore from plinth.modules.firewall.components import Firewall @@ -104,6 +105,12 @@ class ZophApp(app_module.App): # upgrade of zoph database. super().setup(old_version) + # Zoph brings mod-php as dependency and enables it. Re-run apache setup + # to correct it. Disable mod-php, switch back to mpm-event, restart + # apache2 if needed. Set old_version to an non-zero value so that + # Snakeoil certificate is not regnerated. + apache_privileged.setup(old_version=1) + privileged.setup() if not old_version: self.enable()