aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJochen Wiedmann <jochen.wiedmann@gmail.com>2015-02-02 20:04:45 +0000
committerDavid Lawrence <dkl@mozilla.com>2015-02-02 20:04:45 +0000
commitfe2e8f649c29cea8368bbe8efa09450bfb58fc28 (patch)
tree636d0ebe58292480d1eafaecaaa909b111db814e
parent689f76e37a3958097b3e1d88561b9a8d19f1f41a (diff)
downloadbugs-fe2e8f649c29cea8368bbe8efa09450bfb58fc28.tar
bugs-fe2e8f649c29cea8368bbe8efa09450bfb58fc28.tar.gz
bugs-fe2e8f649c29cea8368bbe8efa09450bfb58fc28.tar.bz2
bugs-fe2e8f649c29cea8368bbe8efa09450bfb58fc28.tar.xz
bugs-fe2e8f649c29cea8368bbe8efa09450bfb58fc28.zip
Bug 1121477: Support for Apache HTTPD 2.4
r=dkl,a=glob
-rw-r--r--.htaccess12
-rw-r--r--Bugzilla/Install/Filesystem.pm104
2 files changed, 104 insertions, 12 deletions
diff --git a/.htaccess b/.htaccess
index 7ef20d8b6..14325d152 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,6 +1,16 @@
# Don't allow people to retrieve non-cgi executable files or our private data
<FilesMatch (\.pm|\.pl|\.tmpl|localconfig.*)$>
- deny from all
+ <IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all denied
+ </IfVersion>
+ </IfModule>
+ <IfModule !mod_version.c>
+ Deny from all
+ </IfModule>
</FilesMatch>
Options -Indexes
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 15fca30ee..6d7f14ced 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -47,7 +47,17 @@ our @EXPORT = qw(
use constant HT_DEFAULT_DENY => <<EOT;
# nothing in this directory is retrievable unless overridden by an .htaccess
# in a subdirectory
-deny from all
+<IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all denied
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ Deny from all
+</IfModule>
EOT
###############
@@ -339,11 +349,31 @@ EOT
"$graphsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
# Allow access to .png and .gif files.
<FilesMatch (\\.gif|\\.png)\$>
- Allow from all
+ <IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Allow from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all granted
+ </IfVersion>
+ </IfModule>
+ <IfModule !mod_version.c>
+ Allow from all
+ </IfModule>
</FilesMatch>
# And no directory listings, either.
-Deny from all
+<IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all denied
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ Deny from all
+</IfModule>
EOT
},
@@ -352,28 +382,80 @@ EOT
# if research.att.com ever changes their IP, or if you use a different
# webdot server, you'll need to edit this
<FilesMatch \\.dot\$>
- Allow from 192.20.225.0/24
- Deny from all
+ <IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Allow from 192.20.225.0/24
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require ip 192.20.225.0/24
+ Require all denied
+ </IfVersion>
+ </IfModule>
+ <IfModule !mod_version.c>
+ Allow from 192.20.225.0/24
+ Deny from all
+ </IfModule>
</FilesMatch>
-# Allow access to .png files created by a local copy of 'dot'
-<FilesMatch \\.png\$>
- Allow from all
+ # Allow access to .png files created by a local copy of 'dot'
+ <FilesMatch \\.png\$>
+ <IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Allow from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all granted
+ </IfVersion>
+ </IfModule>
+ <IfModule !mod_version.c>
+ Allow from all
+ </IfModule>
</FilesMatch>
# And no directory listings, either.
-Deny from all
+<IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all denied
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ Deny from all
+</IfModule>
EOT
},
"$assetsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
# Allow access to .css files
<FilesMatch \\.(css|js)\$>
- Allow from all
+ <IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Allow from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all granted
+ </IfVersion>
+ </IfModule>
+ <IfModule !mod_version.c>
+ Allow from all
+ </IfModule>
</FilesMatch>
# And no directory listings, either.
-Deny from all
+<IfModule mod_version.c>
+ <IfVersion <= 2.2>
+ Deny from all
+ </IfVersion>
+ <IfVersion > 2.2>
+ Require all denied
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ Deny from all
+</IfModule>
EOT
},