X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b01179f08d990df3f4a41c87eaba740d5ade29b1..e83395675fe4f9b35a1d83e99c50d1ea6fbe79fd:/cookbooks/mediawiki/templates/default/apache.erb diff --git a/cookbooks/mediawiki/templates/default/apache.erb b/cookbooks/mediawiki/templates/default/apache.erb index 6cbbc76e6..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,19 +48,21 @@ > Options -Indexes -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all granted -<% end -%> - /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 @@ -80,32 +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/> -<% if node[:lsb][:release].to_f >= 14.04 -%> + /w/maintenance/> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> - /LocalSettings.php> -<% if node[:lsb][:release].to_f >= 14.04 -%> + /w/LocalSettings.php> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> - /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 @@ -113,33 +98,18 @@ -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> -<% if @mediawiki[:enable_ssl] -%> +<% if @ssl_enabled -%> ServerName <%= @name %> <% @aliases.each do |alias_name| -%> @@ -172,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 @@ -190,19 +160,20 @@ > Options -Indexes -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all granted -<% end -%> - /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 @@ -214,32 +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/> -<% if node[:lsb][:release].to_f >= 14.04 -%> + /w/maintenance/> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> - /LocalSettings.php> -<% if node[:lsb][:release].to_f >= 14.04 -%> + /w/LocalSettings.php> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> - /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 @@ -247,30 +208,15 @@ -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> -<% if node[:lsb][:release].to_f >= 14.04 -%> Require all denied -<% else -%> - Order allow,deny - Deny from all -<% end -%> <% end -%>