From 919e6e55a9c6c98fe408831905a8b91587af0503 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 17 Oct 2012 17:38:43 +0200 Subject: [PATCH] apache-httpd: Create runtime dir for version 2.4. By default the path is determined related to ServerRoot. Unfortunately ServerRoot is pointing to the Nix store and the web server can't write to it. We now create a directory called "runtime" withen the stateDir and point DefaultRuntimeDir to it. For more information on the DefaultRuntimeDir directive, please see: http://httpd.apache.org/docs/2.4/mod/core.html#defaultruntimedir Signed-off-by: aszlig --- modules/services/web-servers/apache-httpd/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 9a3a3a10541..89fd491fd22 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -303,6 +303,10 @@ let ServerRoot ${httpd} + ${optionalString (!versionOlder httpd.version "2.4") '' + DefaultRuntimeDir ${mainCfg.stateDir}/runtime + ''} + PidFile ${mainCfg.stateDir}/httpd.pid ${optionalString (mainCfg.multiProcessingModule != "prefork") '' @@ -636,6 +640,10 @@ in '' mkdir -m 0750 -p ${mainCfg.stateDir} chown root.${mainCfg.group} ${mainCfg.stateDir} + ${optionalString (!versionOlder httpd.version "2.4") '' + mkdir -m 0750 -p "${mainCfg.stateDir}/runtime" + chown root.${mainCfg.group} "${mainCfg.stateDir}/runtime" + ''} mkdir -m 0700 -p ${mainCfg.logDir} ${optionalString (mainCfg.documentRoot != null)