]> git.openstreetmap.org Git - chef.git/blob - cookbooks/nominatim/recipes/default.rb
put nominatim's php-fpm config under chef control
[chef.git] / cookbooks / nominatim / recipes / default.rb
1 #
2 # Cookbook Name:: nominatim
3 # Recipe:: default
4 #
5 # Copyright 2012, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 include_recipe "apache"
21 include_recipe "postgresql"
22
23 package "php5"
24 package "php5-cli"
25 package "php5-pgsql"
26
27 package "php-apc"
28
29 apache_module "rewrite"
30 apache_module "fastcgi-handler"
31
32 service "php5-fpm" do
33   action [ :enable, :start ]
34   supports :status => true, :restart => true, :reload => true
35 end
36
37 apache_site "nominatim.openstreetmap.org" do
38   template "apache.erb"
39   directory "/home/lonvia/nominatim"
40 end
41
42 template "/etc/php5/fpm/pool.d/www.conf" do
43   source "fpm.conf.erb"
44   owner "root"
45   group "root"
46   mode 0644
47   variables :name => "www", :pm => "dynamic", :max_children => "50"
48   notifies :reload, resources(:service => "php5-fpm")
49 end
50
51 template "/etc/php5/fpm/pool.d/bulk.conf" do
52   source "fpm.conf.erb"
53   owner "root"
54   group "root"
55   mode 0644
56   variables :name => "bulk", :pm => "static", :max_children => "7"
57   notifies :reload, resources(:service => "php5-fpm")
58 end
59
60 postgresql_user "tomh" do
61   cluster "9.1/main"
62   superuser true
63 end
64
65 postgresql_user "lonvia" do
66   cluster "9.1/main"
67   superuser true
68 end
69
70 postgresql_user "twain" do
71   cluster "9.1/main"
72   superuser true
73 end
74
75 postgresql_user "www-data" do
76   cluster "9.1/main"
77 end
78
79 postgresql_munin "nominatim" do
80   cluster "9.1/main"
81   database "nominatim"
82 end