long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "apache"
+depends "passenger"
depends "git"
depends "mysql"
depends "postgresql"
require "yaml"
include_recipe "apache"
+include_recipe "passenger"
include_recipe "git"
include_recipe "mysql"
include_recipe "postgresql"
apache_module "expires"
apache_module "wsgi"
-apache_module "passenger" do
- conf "passenger.conf.erb"
-end
-
-munin_plugin "passenger_memory"
-munin_plugin "passenger_processes"
-munin_plugin "passenger_queues"
-munin_plugin "passenger_requests"
-
gem_package "sqlite3"
gem_package "rails" do
end
rails_port site_name do
- ruby node[:dev][:ruby]
+ ruby node[:passenger][:ruby_version]
directory rails_directory
user "apis"
group "apis"
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-<IfModule mod_passenger.c>
- PassengerRoot /usr
- PassengerRuby /usr/bin/ruby<%= node[:dev][:ruby] %>
- PassengerUseGlobalQueue on
-</IfModule>
--- /dev/null
+Cookbook
+========
+TODO: Enter the cookbook description here.
+
+e.g.
+This cookbook makes your favorite breakfast sandwich.
+
+Requirements
+------------
+TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
+
+Attributes
+----------
+TODO: List you cookbook attributes here.
+
+Usage
+-----
+TODO: Write usage instructions for each cookbook.
+
+Contributing
+------------
+TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
+
+e.g.
+1. Fork the repository on Github
+2. Create a named feature branch (like `add_component_x`)
+3. Write your change
+4. Write tests for your change (if applicable)
+5. Run the tests, ensuring they all pass
+6. Submit a Pull Request using Github
+
+License and Authors
+-------------------
+Authors: TODO: List authors
--- /dev/null
+default[:apt][:sources] = node[:apt][:sources] | [ "brightbox-ruby-ng" ]
+
+default[:passenger][:ruby_version] = "1.9.1"
+default[:passenger][:max_pool_size] = 6
+default[:passenger][:pool_idle_time] = 300
--- /dev/null
+name "passenger"
+maintainer "OpenStreetMap Administrators"
+maintainer_email "admins@openstreetmap.org"
+license "Apache 2.0"
+description "Installs and configures passenger"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "1.0.0"
+depends "apache"
+depends "munin"
--- /dev/null
+#
+# Cookbook Name:: passenger
+# Recipe:: default
+#
+# Copyright 2014, OpenStreetMap Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apache"
+
+template "/usr/local/bin/passenger-ruby" do
+ source "ruby.erb"
+ owner "root"
+ group "root"
+ mode 0755
+ notifies :reload, "service[apache2]"
+end
+
+apache_module "passenger" do
+ conf "passenger.conf.erb"
+end
+
+package "passenger-common#{node[:passenger][:ruby_version]}"
+
+munin_plugin "passenger_memory"
+munin_plugin "passenger_processes"
+munin_plugin "passenger_queues"
+munin_plugin "passenger_requests"
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+
+<IfModule mod_passenger.c>
+ PassengerRoot /usr
+ PassengerRuby /usr/local/bin/passenger-ruby
+ PassengerUseGlobalQueue on
+ PassengerMaxPoolSize <%= node[:passenger][:max_pool_size] %>
+ PassengerPoolIdleTime <%= node[:passenger][:pool_idle_time] %>
+</IfModule>
export RUBY_HEAP_FREE_MIN=100000
export RUBY_GC_MALLOC_LIMIT=50000000
-exec /usr/bin/ruby<%= node[:web][:ruby_version] %> "$@"
+exec /usr/bin/ruby<%= node[:passenger][:ruby_version] %> "$@"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "apache"
+depends "passenger"
depends "git"
attribute "taginfo",
#
include_recipe "apache::ssl"
+include_recipe "passenger"
include_recipe "git"
package "libsqlite3-dev"
gem_package "sinatra-r18n"
gem_package "rack-contrib"
-apache_module "passenger"
-
-munin_plugin "passenger_memory"
-munin_plugin "passenger_processes"
-munin_plugin "passenger_queues"
-munin_plugin "passenger_requests"
-
node[:taginfo][:sites].each do |site|
name = site[:name]
directory = site[:directory] || "/srv/#{name}"
-default[:web][:ruby_version] = "1.9.1"
default[:web][:base_directory] = "/srv/www.openstreetmap.org"
default[:web][:pid_directory] = "/var/run/web"
default[:web][:log_directory] = "/var/log/web"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "apache"
+depends "passenger"
depends "git"
depends "memcached"
depends "tools"
include_recipe "web::base"
include_recipe "apache"
+include_recipe "passenger"
include_recipe "git"
web_passwords = data_bag_item("web", "passwords")
db_passwords = data_bag_item("db", "passwords")
-directory "#{node[:web][:base_directory]}/bin" do
- owner "root"
- group "root"
- mode 0755
-end
-
-template "#{node[:web][:base_directory]}/bin/ruby" do
- source "ruby.erb"
- owner "root"
- group "root"
- mode 0755
- notifies :reload, "service[apache2]"
-end
-
-apache_module "passenger" do
- conf "passenger.conf.erb"
-end
-
-package "passenger-common#{node[:web][:ruby_version]}"
-
-munin_plugin "passenger_memory"
-munin_plugin "passenger_processes"
-munin_plugin "passenger_queues"
-munin_plugin "passenger_requests"
-
template "/etc/cron.hourly/passenger" do
cookbook "web"
source "passenger.cron.erb"
end
rails_port "www.openstreetmap.org" do
- ruby node[:web][:ruby_version]
+ ruby node[:passenger][:ruby_version]
directory rails_directory
user "rails"
group "rails"
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-<IfModule mod_passenger.c>
- PassengerRoot /usr
- PassengerRuby <%= node[:web][:base_directory] %>/bin/ruby
- PassengerUseGlobalQueue on
- PassengerMaxPoolSize <%= node[:web][:rails_daemon_limit] %>
- PassengerPoolIdleTime 0
- #PassengerMaxPreloaderIdleTime 0
-</IfModule>
},
:apt => {
:sources => [
- "brightbox-ruby-ng",
"ubuntugis-stable",
"mapnik-v210"
]
},
:dev => {
- :ruby => "1.9.1",
:rails => {
:master => {
:repository => "git://git.openstreetmap.org/rails.git",
}
}
},
- :apt => {
- :sources => [ "brightbox-ruby-ng" ]
- },
:taginfo => {
:sites => [
{
:memcached => {
:memory_limit => 4096
},
+ :passenger => {
+ :max_pool_size => 12
+ },
:web => {
- :rails_daemon_limit => 12,
:rails_soft_memory_limit => 512,
:rails_hard_memory_limit => 2048
}
:max_requests_per_child => 10000
}
},
+ :passenger => {
+ :max_pool_size => 50
+ },
:web => {
- :rails_daemon_limit => 50,
:rails_soft_memory_limit => 192,
:rails_hard_memory_limit => 512
},
}
}
},
- :apt => {
- :sources => [ "brightbox-ruby-ng" ]
- },
:nfs => {
"/store/rails" => { :host => "ironbelly", :path => "/store/rails" }
},
+ :passenger => {
+ :pool_idle_time => 0
+ },
:web => {
:status => "online",
:database_host => "db",