diff --git a/lib/setup.php b/lib/setup.php
index 2f73c486c9c08cd513a3332f6aa89e98f1f83bfb..027c84db0921fa1c1c4d37ca1bd5c6404027f477 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -257,7 +257,7 @@ class OC_Setup {
 				OC_Installer::installShippedApps();
 
 				//create htaccess files for apache hosts
-				if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
+				if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
 					self::createHtaccess();
 				}