diff --git a/lib/setup.php b/lib/setup.php
index f87581d75827cda77cb54ad5fae321175b087584..04a65d0126542f63afc1b4941413f0c9d897db8e 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -224,7 +224,9 @@ class OC_Setup {
 				OC_Installer::installShippedApps(true);
 
 				//create htaccess files for apache hosts
-				self::createHtaccess(); //TODO detect if apache is used
+				if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
+					self::createHtaccess();
+				}
 
 				//and we are done
 				OC_Config::setValue('installed', true);