Browse files

Working up stack for nginx and apache with some cleanups

  • Loading branch information...
1 parent 6f74a49 commit bad522357497d508f817478697ddde31dd94e689 @benschwarz committed May 16, 2009
Showing with 46 additions and 51 deletions.
  1. +9 −9 config/install.rb
  2. +7 −4 config/stack/apache.rb
  3. +1 −1 config/stack/mysql.rb
  4. +21 −17 config/stack/nginx.rb
  5. +1 −1 config/stack/postgresql.rb
  6. +7 −19 config/stack/ruby_enterprise.rb
View
18 config/install.rb
@@ -1,5 +1,8 @@
$:<< File.join(File.dirname(__FILE__), 'stack')
+# Require the stack base
+%w(essential scm ruby_enterprise memcached postgresql mysql).each(&method(:require))
+
# ===============
# = Web servers =
# ===============
@@ -10,11 +13,8 @@
# These are enabled by default when you choose Apache, you can remove these dependencies within
# stack/apache.rb
-# require 'apache'
-require 'nginx'
-
-# Require the rest of our stack
-%w(essential scm ruby_enterprise memcached postgresql mysql).each(&method(:require))
+require 'apache'
+#require 'nginx'
# What we're installing to your server
# Take what you want, leave what you don't
@@ -23,10 +23,10 @@
requires :webserver # Apache or Nginx
requires :appserver # Passenger
requires :ruby_enterprise # Ruby Enterprise edition
- requires :database # MySQL or Postgres, also installs rubygems for each
- requires :scm # Git
- requires :memcached # Memcached
- requires :libmemcached # Libmemcached
+ #requires :database # MySQL or Postgres, also installs rubygems for each
+ #requires :scm # Git
+ #requires :memcached # Memcached
+ #requires :libmemcached # Libmemcached
end
deployment do
View
11 config/stack/apache.rb
@@ -19,8 +19,12 @@
package :passenger, :provides => :appserver do
description 'Phusion Passenger (mod_rails)'
- version '2.2.1'
+ version '2.2.2'
+ binaries = %w(passenger-config passenger-install-nginx-module passenger-install-apache2-module passenger-make-enterprisey passenger-memory-stats passenger-spawn-server passenger-status passenger-stress-test)
+
gem 'passenger', :version => version do
+ binaries.each {|bin| post :install, "ln -s #{REE_PATH}/bin/#{bin} /usr/local/bin/#{bin}"}
+
post :install, 'echo -en "\n\n\n\n" | sudo passenger-install-apache2-module'
# Create the passenger conf file
@@ -41,12 +45,11 @@
verify do
has_file "/etc/apache2/extras/passenger.conf"
- has_file "/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}/ext/apache2/mod_passenger.so"
- has_directory "/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}"
+ has_file "#{REE_PATH}/ext/apache2/mod_passenger.so"
+ binaries.each {|bin| has_symlink "/usr/local/bin/#{bin}", "#{REE_PATH}/bin/#{bin}" }
end
requires :apache, :apache2_prefork_dev, :ruby_enterprise
- recommends :passenger_binaries
end
# These "installers" are strictly optional, I believe
View
2 config/stack/mysql.rb
@@ -6,7 +6,7 @@
has_executable 'mysql'
end
- recommends :mysql_driver
+ optional :mysql_driver
end
package :mysql_driver, :provides => :ruby_database_driver do
View
38 config/stack/nginx.rb
@@ -9,32 +9,36 @@
# be strange.
package :nginx, :provides => :webserver do
- puts "Nginx installed by passenger"
+ puts "** Nginx installed by passenger gem **"
+ requires :passenger
+
+ push_text File.read(File.join(File.dirname(__FILE__), 'nginx', 'init.d')), "/etc/init.d/nginx", :sudo => true do
+ post :install, "sudo chmod +x /etc/init.d/nginx"
+ post :install, "sudo /usr/sbin/update-rc.d -f nginx defaults"
+ post :install, "sudo /etc/init.d/nginx start"
+ end
+
+ verify do
+ has_executable "/usr/local/nginx/sbin/nginx"
+ has_file "/etc/init.d/nginx"
+ end
end
package :passenger, :provides => :appserver do
description 'Phusion Passenger (mod_rails)'
- version '2.2.3'
+ version '2.2.2'
+ binaries = %w(passenger-config passenger-install-nginx-module passenger-install-apache2-module passenger-make-enterprisey passenger-memory-stats passenger-spawn-server passenger-status passenger-stress-test)
- gem 'passenger', :version => version do
+ gem 'passenger', :version => version do
# Install nginx and the module
+ binaries.each {|bin| post :install, "ln -s #{REE_PATH}/bin/#{bin} /usr/local/bin/#{bin}"}
post :install, "sudo passenger-install-nginx-module --auto --auto-download --prefix=/usr/local/nginx"
-
- post :install do
- # Install nginx init.d script
- #push_text File.read(File.join(File.dirname(__FILE__), 'nginx', 'init.d')), "/etc/init.d/nginx", :sudo => true
- end
-
- #post :install, "sudo chmod +x /etc/init.d/nginx"
- #post :install, "sudo /usr/sbin/update-rc.d -f nginx defaults"
- #post :install, "sudo /etc/init.d/nginx start"
end
requires :ruby_enterprise
- recommends :passenger_binaries
- #verify do
- # has_executable "/usr/local/nginx/sbin/nginx"
- # has_gem "passenger", version
- #end
+ verify do
+ has_gem "passenger", version
+ binaries.each {|bin| has_symlink "/usr/local/bin/#{bin}", "#{REE_PATH}/bin/#{bin}" }
+ end
end
View
2 config/stack/postgresql.rb
@@ -6,7 +6,7 @@
has_executable 'psql'
end
- recommends :postgresql_driver
+ optional :postgresql_driver
end
package :postgresql_driver, :provides => :ruby_database_driver do
View
26 config/stack/ruby_enterprise.rb
@@ -1,36 +1,24 @@
package :ruby_enterprise do
description 'Ruby Enterprise Edition'
version '1.8.6-20090421'
-
- install_path = "/usr/local/ruby-enterprise"
+ REE_PATH = "/usr/local/ruby-enterprise"
+
binaries = %w(erb gem irb rackup rails rake rdoc ree-version ri ruby testrb)
source "http://rubyforge.org/frs/download.php/55511/ruby-enterprise-#{version}.tar.gz" do
custom_install 'sudo ./installer --auto=/usr/local/ruby-enterprise'
-
- binaries.each {|bin| post :install, "ln -s #{install_path}/bin/#{bin} /usr/local/bin/#{bin}" }
+ binaries.each {|bin| post :install, "ln -s #{REE_PATH}/bin/#{bin} /usr/local/bin/#{bin}" }
end
verify do
has_directory install_path
- has_executable "#{install_path}/bin/ruby"
- binaries.each {|bin| has_symlink "/usr/local/bin/#{bin}", "#{install_path}/bin/#{bin}" }
+ has_executable "#{REE_PATH}/bin/ruby"
+ binaries.each {|bin| has_symlink "/usr/local/bin/#{bin}", "#{REE_PATH}/bin/#{bin}" }
end
requires :ree_dependencies
end
package :ree_dependencies do
apt %w(zlib1g-dev libreadline5-dev libssl-dev)
- # requires :build_essential
-end
-
-package :passenger_binaries do
- description "Symlinks passenger binaries"
- binaries = %w(passenger-config passenger-install-nginx-module passenger-install-apache2-module passenger-make-enterprisey passenger-memory-stats passenger-spawn-server passenger-status passenger-stress-test)
- install_path = "/usr/local/ruby-enterprise"
- binaries.each {|bin| post :install, "ln -s #{install_path}/bin/#{bin} /usr/local/bin/#{bin}" }
-
- verify do
- binaries.each {|bin| has_symlink "/usr/local/bin/#{bin}", "#{install_path}/bin/#{bin}" }
- end
-end
+ requires :build_essential
+end

0 comments on commit bad5223

Please sign in to comment.