Skip to content

Instantly share code, notes, and snippets.

@knewter
Created January 11, 2011 18:21
Show Gist options
  • Select an option

  • Save knewter/774840 to your computer and use it in GitHub Desktop.

Select an option

Save knewter/774840 to your computer and use it in GitHub Desktop.
# cookbooks/passenger/recipes/default.rb
require_recipe "apache2"
# Required to compile passenger
package "apache2-prefork-dev"
rvm_gem ["passenger"] do
action :install
ruby node[:rvm][:default_ruby]
version node[:passenger][:version]
end
rvm_gem ["SyslogLogger"] do
action :install
ruby node[:rvm][:default_ruby]
end
execute "passenger_module" do
command 'echo -en "\n\n\n\n" | passenger-install-apache2-module'
creates node[:passenger][:module_path]
end
template node[:passenger][:apache_load_path] do
source "passenger.load.erb"
owner "root"
group "root"
mode 0755
notifies :restart, resources(:service => "apache2")
end
template node[:passenger][:apache_conf_path] do
source "passenger.conf.erb"
owner "root"
group "root"
mode 0755
notifies :restart, resources(:service => "apache2")
end
remote_file "/usr/local/bin/passenger_monitor" do
source "passenger_monitor"
mode 0755
end
cron "passenger memory monitor" do
command "/usr/local/bin/passenger_monitor #{node[:passenger][:soft_memory_limit]} #{node[:passenger][:hard_memory_limit]}"
end
apache_module "passenger"
include_recipe "apache2::mod_deflate"
include_recipe "apache2::mod_rewrite"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment