From fc1cac8e5a7c219e24452c9a880750e3d2941e18 Mon Sep 17 00:00:00 2001 From: BeauTroll <-> Date: Sat, 3 Jan 2026 04:14:41 +0100 Subject: [PATCH] fix: properly configure Apache MPM Prefork with dedicated config file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create dedicated apache/mpm_prefork.conf to override default MPM settings - Mount mpm_prefork.conf to /etc/apache2/mods-available/ to properly apply limits - Remove MPM config from nextcloud.conf (was being ignored) - Set ServerLimit and MaxRequestWorkers to 400 (up from 150 default) - Configure optimized worker settings for better concurrency This fixes the "server reached MaxRequestWorkers" error that was causing sync failures and 404 errors by properly overriding Apache's default configuration file instead of trying to set it in conf-enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- apache/mpm_prefork.conf | 16 ++++++++++++++++ apache/nextcloud.conf | 10 ---------- docker-compose.yml | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 apache/mpm_prefork.conf diff --git a/apache/mpm_prefork.conf b/apache/mpm_prefork.conf new file mode 100644 index 0000000..392c7f6 --- /dev/null +++ b/apache/mpm_prefork.conf @@ -0,0 +1,16 @@ +# prefork MPM +# StartServers: number of server processes to start +# MinSpareServers: minimum number of server processes which are kept spare +# MaxSpareServers: maximum number of server processes which are kept spare +# ServerLimit: maximum value for MaxRequestWorkers (must be set before MaxRequestWorkers) +# MaxRequestWorkers: maximum number of server processes allowed to start +# MaxConnectionsPerChild: maximum number of requests a server process serves + + + ServerLimit 400 + StartServers 10 + MinSpareServers 10 + MaxSpareServers 20 + MaxRequestWorkers 400 + MaxConnectionsPerChild 1000 + diff --git a/apache/nextcloud.conf b/apache/nextcloud.conf index d9cb747..424650c 100644 --- a/apache/nextcloud.conf +++ b/apache/nextcloud.conf @@ -19,16 +19,6 @@ KeepAlive On KeepAliveTimeout 300 MaxKeepAliveRequests 200 -# Configuration MPM Prefork - Augmentation des workers - - ServerLimit 400 - StartServers 10 - MinSpareServers 10 - MaxSpareServers 20 - MaxRequestWorkers 400 - MaxConnectionsPerChild 1000 - - Options FollowSymLinks MultiViews AllowOverride All diff --git a/docker-compose.yml b/docker-compose.yml index 803f9fe..099edba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: volumes: - ./data:/var/www/html - ./apache/nextcloud.conf:/etc/apache2/conf-enabled/nextcloud.conf:ro + - ./apache/mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf:ro - ./logs/apache:/var/log/apache2 logging: driver: "json-file"