1 # DO NOT EDIT - This file is being maintained by Chef
3 <% [80, 443].each do |port| -%>
4 <VirtualHost *:<%= port %>>
5 ServerName <%= node[:fqdn] %>
6 ServerAlias nominatim.openstreetmap.org
7 ServerAlias nominatim.osm.org
8 ServerAlias nominatim.openstreetmap.org
9 ServerAlias nominatim.openstreetmap.net
10 ServerAlias nominatim.openstreetmaps.org
11 ServerAlias nominatim.openmaps.org
12 ServerAdmin webmaster@openstreetmap.org
21 CustomLog /var/log/apache2/nominatim.openstreetmap.org-access.log combined
22 ErrorLog /var/log/apache2/nominatim.openstreetmap.org-error.log
24 DocumentRoot <%= @directory %>/website
25 <Directory "<%= @directory %>/website/">
26 DirectoryIndex search.php
27 Options FollowSymLinks
28 <% if node[:lsb][:release].to_f >= 14.04 -%>
33 <% if node[:lsb][:release].to_f >= 14.04 -%>
34 ProxyPassMatch ^/([^/]*\.php(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%><%= @directory %>/website/$1
36 <LocationMatch ^/([^/]*\.php(/.*)?)$>
37 SetHandler fcgi:/var/run/php5-fpm-www.sock
41 <% @pools.each do |name,details| -%>
42 Alias /pool-<%= name %>/ "<%= @directory %>/website/"
43 <% if node[:lsb][:release].to_f >= 14.04 -%>
44 ProxyPassMatch ^/pool-<%= name %>/(.*\.php(/.*)?) fcgi://127.0.0.1:<%= details[:port ]%><%= @directory %>/website/$1
46 <LocationMatch ^/pool-<%= name %>/(.*\.php(/.*)?)$>
47 SetHandler fcgi:/var/run/php5-fpm-<%= name %>.sock
52 <% if node[:lsb][:release].to_f >= 14.04 -%>
53 Redirect 429 /pool-block/
54 ErrorDocument 429 /509.html
55 <Location /pool-block>
56 ErrorDocument 429 /509.html
59 Redirect 420 /pool-block/
60 ErrorDocument 420 /509.html
61 <Location /pool-block>
62 ErrorDocument 420 /509.html
65 Redirect 403 /pool-ban/
67 ErrorDocument 403 /403.html
69 ErrorDocument 403 /403.html
74 Include <%= @directory %>/settings/apache_blocks.conf
76 # regular requests and autoblocks
77 RewriteMap bulklist txt:<%= @directory %>/settings/ip_blocks.map
78 RewriteRule ^/(search|reverse|details)(\.php)?(/.*)? /pool-${bulklist:%{REMOTE_ADDR}|www}/$1.php$3 [PT]