]> git.openstreetmap.org Git - chef.git/blob - cookbooks/nominatim/templates/default/apache.erb
Supermicro X9DRW has serial console on ttyS1
[chef.git] / cookbooks / nominatim / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <% [80, 443].each do |port| -%>
4 <VirtualHost *:<%= port %>>
5     ServerName nominatim.openstreetmap.org
6     ServerAdmin webmaster@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
13 <% if port == 443 -%>
14     #
15     # Enable SSL
16     #
17     SSLEngine on
18 <% end -%>
19
20     CustomLog /var/log/apache2/nominatim.openstreetmap.org-access.log combined
21     ErrorLog /var/log/apache2/nominatim.openstreetmap.org-error.log
22
23     DocumentRoot <%= @directory %>/website
24     <Directory "<%= @directory %>/website/">
25         DirectoryIndex search.php
26         Options MultiViews FollowSymLinks
27         AddType text/html   .php
28         AddType application/xml   .phpx
29         AddType application/json   .phpj
30         AddHandler fcgi:/var/run/php5-fpm-www.sock .php
31         AddHandler fcgi:/var/run/php5-fpm-www.sock .phpx
32         AddHandler fcgi:/var/run/php5-fpm-www.sock .phpj
33     </Directory>
34
35     <% @pools.each do |name,details| -%>
36     Alias /pool-<%= name %>/ "<%= @directory %>/website/"
37     <Location /pool-<%= name %>>
38         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .php
39         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpx
40         AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpj
41     </Location>
42     <% end -%>
43
44     Redirect 420 /pool-block/
45     ErrorDocument 420 /509.html
46     <Location /pool-block>
47         ErrorDocument 420 /509.html
48     </Location>
49     Redirect 403 /pool-ban/
50     <Location /pool-ban>
51         ErrorDocument 403 /403.html
52     </Location>
53     ErrorDocument 403 /403.html
54
55     RewriteEngine On
56
57     # manual blocks
58     Include <%= @directory %>/settings/apache_blocks.conf
59
60     # regular requests and autoblocks
61     RewriteMap bulklist txt:<%= @directory %>/settings/ip_blocks.map
62     RewriteRule ^/([sdr].*) /pool-${bulklist:%{REMOTE_ADDR}|www}/$1 [PT]
63
64 </VirtualHost>
65
66 <% end -%>