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