Skip to content

Commit

Permalink
Refs #4499 #4941 Adding <IfModule !mod_authz_host.c> around the Satis…
Browse files Browse the repository at this point in the history
…fy any which may fix the issue.

To test run the following command in the piwik directory:
```
rm js/.htaccess plugins/.htaccess core/.htaccess libs/.htaccess vendor/.htaccess  misc/user/.htaccess
```
(this deletes all current htaccess files)

Then visit the System check page
(this re-creates the .htaccess files)

Then browse Piwik -> is it working fine?

If not, check your error log and please paste error as a comment in the ticket.
  • Loading branch information
mattab committed May 14, 2014
1 parent 2be9dbd commit 6e83e22
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions plugins/Installation/ServerFilesGenerator.php
Expand Up @@ -30,12 +30,17 @@ public static function createHtAccessFiles()
}

// Allow/Deny lives in different modules depending on the Apache version
$allow = "<IfModule mod_access.c>\nAllow from all\nRequire all granted\n</IfModule>\n<IfModule !mod_access_compat>\n<IfModule mod_authz_host.c>\nAllow from all\nRequire all granted\n</IfModule>\n</IfModule>\n<IfModule mod_access_compat>\nAllow from all\nRequire all granted\n</IfModule>\n";
$deny = "<IfModule mod_access.c>\nDeny from all\nRequire all denied\n</IfModule>\n<IfModule !mod_access_compat>\n<IfModule mod_authz_host.c>\nDeny from all\nRequire all denied\n</IfModule>\n</IfModule>\n<IfModule mod_access_compat>\nDeny from all\nRequire all denied\n</IfModule>\n";
$allow = "<IfModule mod_access.c>\nAllow from all\nRequire all granted\n</IfModule>\n".
"<IfModule !mod_access_compat>\n<IfModule mod_authz_host.c>\nAllow from all\nRequire all granted\n</IfModule>\n</IfModule>\n".
"<IfModule mod_access_compat>\nAllow from all\nRequire all granted\n</IfModule>\n".
"<IfModule !mod_authz_host.c>\nSatisfy any</IfModule>\n";
$deny = "<IfModule mod_access.c>\nDeny from all\nRequire all denied\n</IfModule>\n".
"<IfModule !mod_access_compat>\n<IfModule mod_authz_host.c>\nDeny from all\nRequire all denied\n</IfModule>\n</IfModule>\n".
"<IfModule mod_access_compat>\nDeny from all\nRequire all denied\n</IfModule>\n";

// more selective allow/deny filters
$allowAny = "<Files \"*\">\n" . $allow . "Satisfy any\n</Files>\n";
$allowStaticAssets = "<Files ~ \"\\.(test\.php|gif|ico|jpg|png|svg|js|css|htm|html|swf)$\">\n" . $allow . "Satisfy any\n</Files>\n";
$allowAny = "<Files \"*\">\n" . $allow . "\n</Files>\n";
$allowStaticAssets = "<Files ~ \"\\.(test\.php|gif|ico|jpg|png|svg|js|css|htm|html|swf)$\">\n" . $allow . "\n</Files>\n";
$denyDirectPhp = "<Files ~ \"\\.(php|php4|php5|inc|tpl|in|twig)$\">\n" . $deny . "</Files>\n";

$directoriesToProtect = array(
Expand Down

0 comments on commit 6e83e22

Please sign in to comment.