X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4f10eb951399adea7cd598b2d763969c735bc888..1b2a50a03b5beaf0d4f2e126bee875b6f66fc1bd:/cookbooks/mediawiki/templates/default/apache.erb diff --git a/cookbooks/mediawiki/templates/default/apache.erb b/cookbooks/mediawiki/templates/default/apache.erb index 40e206d1b..16f97362d 100644 --- a/cookbooks/mediawiki/templates/default/apache.erb +++ b/cookbooks/mediawiki/templates/default/apache.erb @@ -30,7 +30,7 @@ RedirectMatch 301 ^/api\.php$ /w/api.php RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php - Alias /wiki <%= @mediawiki[:directory] %>/index.php + Alias /wiki <%= @directory %>/w/index.php #Support /pagename -> /wiki/pagename RewriteEngine on @@ -48,16 +48,21 @@ > Options -Indexes + Require all granted - /images/> + /w/images/> # No php execution in the upload area php_admin_flag engine off Options -ExecCGI -Includes -Indexes AllowOverride None + AddType text/plain .html .htm .shtml +<% if @private -%> + Require all denied +<% end -%> - /images/thumb/> + /w/images/thumb/> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f @@ -77,24 +82,15 @@ RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B] - /maintenance/> - Order allow,deny - Deny from all + /w/maintenance/> + Require all denied - /LocalSettings.php> - Order allow,deny - Deny from all + /w/LocalSettings.php> + Require all denied - /images/> - Options -ExecCGI -Includes -Indexes - AllowOverride None - AddType text/plain .html .htm .shtml - php_admin_flag engine off - - - /cache/> + /w/cache/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml @@ -102,21 +98,18 @@ - Order allow,deny - Deny from all + Require all denied - Order allow,deny - Deny from all + Require all denied - Order allow,deny - Deny from all + Require all denied -<% if @mediawiki[:enable_ssl] -%> +<% if @ssl_enabled -%> ServerName <%= @name %> <% @aliases.each do |alias_name| -%> @@ -149,7 +142,7 @@ RedirectMatch 301 ^/api\.php$ /w/api.php RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php - Alias /wiki <%= @mediawiki[:directory] %>/index.php + Alias /wiki <%= @directory %>/w/index.php #Support /pagename -> /wiki/pagename RewriteEngine on @@ -167,16 +160,20 @@ > Options -Indexes + Require all granted - /images/> + /w/images/> # No php execution in the upload area php_admin_flag engine off Options -ExecCGI -Includes -Indexes AllowOverride None +<% if @private -%> + Require all denied +<% end -%> - /images/thumb/> + /w/images/thumb/> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f @@ -188,24 +185,22 @@ RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B] - /maintenance/> - Order allow,deny - Deny from all + /w/maintenance/> + Require all denied - /LocalSettings.php> - Order allow,deny - Deny from all + /w/LocalSettings.php> + Require all denied - /images/> + /w/images/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml php_admin_flag engine off - /cache/> + /w/cache/> Options -ExecCGI -Includes -Indexes AllowOverride None AddType text/plain .html .htm .shtml @@ -213,18 +208,15 @@ - Order allow,deny - Deny from all + Require all denied - Order allow,deny - Deny from all + Require all denied - Order allow,deny - Deny from all + Require all denied <% end -%>