Skip to content

Commit

Permalink
[RELEASE] Zero to hero
Browse files Browse the repository at this point in the history
Updated README
Added some varification steps
Removed rm'ing of binaries that would not be installed by this stack
  • Loading branch information
benschwarz committed Dec 23, 2008
1 parent 30a7f60 commit 21136a0
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 38 deletions.
33 changes: 28 additions & 5 deletions README.markdown
@@ -1,8 +1,26 @@
# Passenger stack
# Passenger stack, zero to hero in under five minutes
Scripts for [Sprinkle](http://github.com/crafterm/sprinkle/ "Sprinkle"), the provisioning tool

## Scripts for [Sprinkle](http://github.com/crafterm/sprinkle/ "Sprinkle"), the provisioning tool
## How to get your sprinkle on:

Deploy a basic stack for running rack based ruby applications with ease!
* Get a brand spanking new slice (ubuntu please)
* Create yourself a user, add yourself to the sudoers file
* Apt-get update
* Set your slices url / ip address in deploy.rb (deploy.rb.example provided)

From your local system (from the passenger-stack directory), run:

sprinkle -c -s install.rb

After you've waited for everything to run, you should have a provisioned slice.
Go forth and install your custom configurations, add vhosts and other VPS paraphernalia.

Other things you should probably consider:

* Close everything except for port 80 and 22
* Disallow password logins and use a passphrased RSA key

### Wait, what does it install?

* Apache (Apt)
* Ruby enterprise (Source) [includes rubygems]
Expand All @@ -11,12 +29,17 @@ Deploy a basic stack for running rack based ruby applications with ease!
* MySQL (Apt)
* Git (Apt)

### Requirements
## Requirements
* Ruby
* Capistrano
* Sprinkle (github.com/crafterm/sprinkle)
* An Ubuntu based VPS (known to not work on Debian Etch, haven't looked into why)

### Thanks
## Thanks

Marcus Crafter and other Sprinkle contributors

## Disclaimer

Don't run this on a system that has already been deemed "in production", its not malicious, but theres a fair chance
that you'll ass something up monumentally. You have been warned.
14 changes: 5 additions & 9 deletions config/deploy.rb.example
@@ -1,10 +1,6 @@
set :application, "your-app"
set :repository, "git@github.com:you/your-app.git"
set :server_url, "your-app-server.com"
set :scm, :git
# Fill slice_url in
set :slice_url, "your-app-server.com"

role :app, server_url
role :web, server_url
role :db, server_url, :primary => true

set :deploy_to, "/var/www/#{application}"
role :app, slice_url
role :web, slice_url
role :db, slice_url, :primary => true
1 change: 1 addition & 0 deletions config/install.rb
Expand Up @@ -9,6 +9,7 @@
requires :webserver
requires :scm
requires :memcached
requires :ruby_enterprise
end

deployment do
Expand Down
4 changes: 4 additions & 0 deletions config/stack/memcached.rb
@@ -1,6 +1,10 @@
package :memcached_daemon, :provides => :memcached do
description 'Memcached, a distributed memory object store'
apt %w( memcached )

verify do
has_process "memcached"
end
end

package :libmemcached do
Expand Down
4 changes: 4 additions & 0 deletions config/stack/mysql.rb
@@ -1,6 +1,10 @@
package :mysql, :provides => :database do
description 'MySQL Database'
apt %w( mysql-server mysql-client libmysqlclient15-dev )

verify do
has_process 'mysql'
end
end

package :mysql_driver do
Expand Down
10 changes: 4 additions & 6 deletions config/stack/ruby_enterprise.rb
Expand Up @@ -12,21 +12,19 @@

# Remove standard ruby binaries
post :install, 'rm /usr/local/bin/ruby'
post :install, 'rm /usr/local/bin/ruby18'
post :install, 'rm /usr/local/bin/gem'
post :install, 'rm /usr/local/bin/rake'
post :install, 'rm /usr/local/bin/rails'

# Symlink ruby enterprise binaries
%w(ruby gem rake rails).each do |bin|
post :install, "ln -s /opt/ruby-enterprise-#{version}/bin/#{bin} /usr/local/bin/"
end
end

verify do
has_directory "/opt/ruby-enterprise-#{version}"
has_executable "/opt/ruby-enterprise-#{version}/bin/ruby"
end
# verify do
# has_directory "/opt/ruby-enterprise-#{version}"
# has_executable "/opt/ruby-enterprise-#{version}/bin/ruby"
# end

requires :apache
requires :passenger
Expand Down
4 changes: 4 additions & 0 deletions config/stack/scm.rb
Expand Up @@ -3,6 +3,10 @@
version '1.5.6.3'
source "http://kernel.org/pub/software/scm/git/git-#{version}.tar.gz"
requires :git_dependencies

verify do
has_file '/usr/local/bin/git'
end
end

package :git_dependencies do
Expand Down
36 changes: 18 additions & 18 deletions config/stack/server.rb
@@ -1,3 +1,19 @@
package :apache, :provides => :webserver do
description 'Apache2 web server.'
apt 'apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert' do
post :install, 'a2enmod rewrite'
end

verify do
has_process 'apache2'
end
end

package :apache2_prefork_dev do
description 'A dependency required by some packages.'
apt 'apache2-prefork-dev'
end

package :passenger, :provides => :appserver do
description 'Phusion Passenger (mod_rails)'
gem 'passenger' do
Expand All @@ -21,27 +37,11 @@

verify do
has_file '/etc/apache2/extras/passenger.conf'
has_file '/usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so'
has_directory '/usr/lib/ruby/gems/1.8/gems/passenger-2.0.6'
has_file '/usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so'
has_directory '/usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6'
end

requires :apache
requires :apache2_prefork_dev
requires :ruby
end

package :apache, :provides => :webserver do
description 'Apache2 web server.'
apt 'apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert' do
post :install, 'a2enmod rewrite'
end

verify do
has_process 'apache2'
end
end

package :apache2_prefork_dev do
description 'A dependency required by some packages.'
apt 'apache2-prefork-dev'
end

0 comments on commit 21136a0

Please sign in to comment.