From 9a94e561a5e53c882f5c7f7fd883692f920c224f Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 3 Aug 2010 13:48:08 +0000 Subject: [PATCH] The DocumentRoot directory is now automatically created if it does not exists. This will prevent the service from working if a user forgets to create the DocumentRoot directory himself and this also makes automated testing easier. svn path=/nixos/trunk/; revision=22929 --- modules/services/web-servers/apache-httpd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index d31d62a03086..c0505a427aa9 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -582,6 +582,13 @@ in mkdir -m 0700 -p ${mainCfg.stateDir} mkdir -m 0700 -p ${mainCfg.logDir} + ${optionalString (mainCfg.documentRoot != null) + '' + # Create the document root directory if does not exists yet + mkdir -p ${mainCfg.documentRoot} + '' + } + # Get rid of old semaphores. These tend to accumulate across # server restarts, eventually preventing it from restarting # succesfully.