summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r--lib/private/Setup.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index d7c6df3535a..024d0754c61 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -542,19 +542,27 @@ class Setup {
//Require all denied
$now = date('Y-m-d H:i:s');
$content = "# Generated by Nextcloud on $now\n";
- $content.= "# line below if for Apache 2.4\n";
+ $content.= "# Section for Apache 2.4 and 2.5\n";
$content.= "<ifModule mod_authz_core.c>\n";
- $content.= "Require all denied\n";
+ $content.= " Require all denied\n";
+ $content.= "</ifModule>\n";
+ $content.= "<ifModule mod_access_compat.c>\n";
+ $content.= " Deny from all\n";
+ $content.= " Satisfy All\n";
$content.= "</ifModule>\n\n";
- $content.= "# line below if for Apache 2.2\n";
+ $content.= "# Section for Apache 2.2\n";
$content.= "<ifModule !mod_authz_core.c>\n";
- $content.= "deny from all\n";
- $content.= "Satisfy All\n";
+ $content.= " <ifModule !mod_access_compat.c>\n";
+ $content.= " <ifModule mod_authz_host.c>\n";
+ $content.= " Deny from all\n";
+ $content.= " </ifModule>\n";
+ $content.= " Satisfy All\n";
+ $content.= " </ifModule>\n";
$content.= "</ifModule>\n\n";
- $content.= "# section for Apache 2.2 and 2.4\n";
+ $content.= "# Section for Apache 2.2 to 2.5\n";
$content.= "<ifModule mod_autoindex.c>\n";
- $content.= "IndexIgnore *\n";
- $content.= "</ifModule>\n";
+ $content.= " IndexIgnore *\n";
+ $content.= "</ifModule>";
$baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
file_put_contents($baseDir . '/.htaccess', $content);