On 08/03/2015 08:36 PM, Sunil Mohan wrote:
[...]
> Here is my understanding:
> 
> apache2 package used to and still ships with all the mpm modules.  The
> extra mpm-* modules simply used to select one module or the other.  Now,
> those packages are all gone.  Depending on a package to select an MPM
> model is not possible now.  The mod-php5 now does an 'a2enmod
> mpm_prefork' instead of depending on the package.  I assume that this
> the preferred and only way to change apache's MPM now.
> 
> Earlier we explicitly chose mpm-worker and switched to mpm-prefork when
> needed (ownCloud).  With this patch we leave apache to pick its default
> MPM and switch to mpm-prefork when needed.  In any case, mpm-* packages
> are gone and MPM is selected using a2(dis|en)mod.
> 
> Perhaps I can test for something and make sure we are still good.  If
> debootstrap doesn't work, it should be easy to catch.
> 

The attached patch proposes to select Apache MPM prefork by default.

Since FreedomBox uses many PHP applications and PHP, at least on Debian,
needs single threaded process.  When switching to prefork MPM during the
installation of PHP applications, Apache restart is requried disrupting
connections to Plinth.  So, select it by default.

I have done the following tests on fully built image:

- Apache should be running as MPM prefork

- Plinth should be accessible.

-- 
Sunil
From ad5b7af8c5e6f2bc2efef8cae65b1b6fc6a9ec35 Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa <su...@medhas.org>
Date: Fri, 28 Aug 2015 18:01:26 +0530
Subject: [PATCH 1/2] Select Apache MPM prefork by default

Since FreedomBox uses many PHP applications and PHP, at least on Debian,
needs single threaded process.  When switching to prefork MPM during the
installation of PHP applications, Apache restart is requried disrupting
connections to Plinth.  So, select it by default.
---
 setup.d/90_apache2 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/setup.d/90_apache2 b/setup.d/90_apache2
index 802eaa7..e03e43c 100755
--- a/setup.d/90_apache2
+++ b/setup.d/90_apache2
@@ -4,6 +4,10 @@
 
 echo "Configuring Apache..."
 
+# enable non-multithreaded Apache worker model as there a many PHP
+# applications.
+a2enmod mpm_prefork
+
 # enable miscellaneous modules.
 a2enmod rewrite
 
-- 
2.5.0


From 23d2dce84974ffaab210252b5a7eb794d8325318 Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa <su...@medhas.org>
Date: Sat, 29 Aug 2015 17:06:55 +0530
Subject: [PATCH 2/2] Disable other MPMs

---
 setup.d/90_apache2 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/setup.d/90_apache2 b/setup.d/90_apache2
index e03e43c..585f613 100755
--- a/setup.d/90_apache2
+++ b/setup.d/90_apache2
@@ -6,6 +6,8 @@ echo "Configuring Apache..."
 
 # enable non-multithreaded Apache worker model as there a many PHP
 # applications.
+a2dismod mpm_event
+a2dismod mpm_worker
 a2enmod mpm_prefork
 
 # enable miscellaneous modules.
-- 
2.5.0

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to