@@ -556,19 +556,29 @@ public static function protectDataDirectory() {
556556 //Require all denied
557557 $ now = date ('Y-m-d H:i:s ' );
558558 $ content = "# Generated by Nextcloud on $ now \n" ;
559- $ content .= "# line below if for Apache 2.4 \n" ;
560- $ content .= "<ifModule mod_authz_core.c> \n" ;
561- $ content .= "Require all denied \n" ;
562- $ content .= "</ifModule> \n\n" ;
563- $ content .= "# line below if for Apache 2.2 \n" ;
564- $ content .= "<ifModule !mod_authz_core.c> \n" ;
565- $ content .= "deny from all \n" ;
566- $ content .= "Satisfy All \n" ;
567- $ content .= "</ifModule> \n\n" ;
568- $ content .= "# section for Apache 2.2 and 2.4 \n" ;
569- $ content .= "<ifModule mod_autoindex.c> \n" ;
570- $ content .= "IndexIgnore * \n" ;
571- $ content .= "</ifModule> \n" ;
559+ $ content .= "# Section for Apache 2.4 to 2.6 \n" ;
560+ $ content .= "<IfModule mod_authz_core.c> \n" ;
561+ $ content .= " Require all denied \n" ;
562+ $ content .= "</IfModule> \n" ;
563+ $ content .= "<IfModule mod_access_compat.c> \n" ;
564+ $ content .= " Order Allow,Deny \n" ;
565+ $ content .= " Deny from all \n" ;
566+ $ content .= " Satisfy All \n" ;
567+ $ content .= "</IfModule> \n\n" ;
568+ $ content .= "# Section for Apache 2.2 \n" ;
569+ $ content .= "<IfModule !mod_authz_core.c> \n" ;
570+ $ content .= " <IfModule !mod_access_compat.c> \n" ;
571+ $ content .= " <IfModule mod_authz_host.c> \n" ;
572+ $ content .= " Order Allow,Deny \n" ;
573+ $ content .= " Deny from all \n" ;
574+ $ content .= " <IifModule> \n" ;
575+ $ content .= " Satisfy All \n" ;
576+ $ content .= " </IfModule> \n" ;
577+ $ content .= "</IfModule> \n\n" ;
578+ $ content .= "# Section for Apache 2.2 to 2.6 \n" ;
579+ $ content .= "<IfModule mod_autoindex.c> \n" ;
580+ $ content .= " IndexIgnore * \n" ;
581+ $ content .= "</IfModule> " ;
572582
573583 $ baseDir = \OC ::$ server ->getConfig ()->getSystemValue ('datadirectory ' , \OC ::$ SERVERROOT . '/data ' );
574584 file_put_contents ($ baseDir . '/.htaccess ' , $ content );
0 commit comments