From 5655ec0efa3839217dae12742d585c11d25dd693 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 17 Oct 2012 17:03:50 +0200 Subject: [PATCH] apache-httpd: Avoid NameVirtualHost in >= v2.4. NameVirtualHost no longer has any effect on version 2.4 and just emits ugly warnings, so let's not use it if we use 2.4. More information: http://httpd.apache.org/docs/2.4/upgrading.html#misc Signed-off-by: aszlig --- modules/services/web-servers/apache-httpd/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 29a20cae162..9a3a3a10541 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -373,7 +373,9 @@ let ${let ports = map getPort allHosts; uniquePorts = uniqList {inputList = ports;}; - in concatMapStrings (port: "NameVirtualHost *:${toString port}\n") uniquePorts + isNeeded = versionOlder httpd.version "2.4"; + directives = concatMapStrings (port: "NameVirtualHost *:${toString port}\n") uniquePorts; + in optionalString isNeeded directives } ${let