diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-11-08 10:45:35 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-11-08 10:45:35 +0100 |
commit | 9c8b1e1775ecd9cc4fbd7ce11cc94ca9c0469f1a (patch) | |
tree | 546282f202b81379ec31acaa309b2744afd6d907 /lib/private/setup.php | |
parent | 4459d964d6af1f9a1c12e3132b8609fc0f40dc98 (diff) | |
download | nextcloud-server-9c8b1e1775ecd9cc4fbd7ce11cc94ca9c0469f1a.tar.gz nextcloud-server-9c8b1e1775ecd9cc4fbd7ce11cc94ca9c0469f1a.zip |
adding proper htaccess commands for Apache 2.4
Diffstat (limited to 'lib/private/setup.php')
-rw-r--r-- | lib/private/setup.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/setup.php b/lib/private/setup.php index 9c3034dc06b..d15d4a3fbed 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -165,8 +165,15 @@ class OC_Setup { } public static function protectDataDirectory() { - $content = "deny from all\n"; - $content.= "IndexIgnore *"; + //Require all denied + $now = date('Y-m-d H:i:s'); + $content = "# Generated by ownCloud on $now\n"; + $content.= "# line below if for Apache 2.4 - please uncomment if you run Apache 2.4\n"; + $content.= "# Require all denied\n\n"; + $content.= "# line below if for Apache 2.2 - please remove it once you upgrade to Apache 2.4\n"; + $content.= "deny from all\n\n"; + $content.= "# section for Apache 2.2 and 2.4\n"; + $content.= "IndexIgnore *\n"; file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.htaccess', $content); file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/index.html', ''); } |