Permalink
Browse files

Moving some recipe calls to more appropriate places, README update

  • Loading branch information...
1 parent 55a2c18 commit e437f7a0fc780f1974a443ec40be64ebdcfb9f05 Winton Welsh committed Aug 4, 2008
Showing with 44 additions and 15 deletions.
  1. +36 −12 README.markdown
  2. +4 −2 recipes/debian.rb
  3. +3 −1 recipes/deploy.rb
  4. +1 −0 recipes/monit.rb
View
@@ -7,14 +7,15 @@ Cookbook takes you from a fresh Debian/Ubuntu server to a complete Nginx/Rails/P
The stack
---------
-- Git
-- Nginx
-- Monit
-- MySQL
-- PHP (spawn-fcgi)
-- Rails
-- Ruby
-- RubyGems
+* Git
+* Nginx
+* Monit
+* MySQL
+* PHP (Nginx w/ spawn-fcgi)
+* Rails
+* Ruby
+* RubyGems
+* Sphinx
Install
@@ -34,7 +35,7 @@ Install
Copy **config/cookbook/deploy.rb.example** to **config/deploy.rb**
-Edit **deploy.rb** to your liking. Run `cap -T` to check out your new tasks.
+Edit **config/deploy.rb** to your liking. Run `cap -T` to check out your new tasks.
Create the deploy user
@@ -46,7 +47,7 @@ If you can't log in as root directly, but have the password (ServerBeach):
su
-### Change root's password
+### Change root's password if you already haven't
passwd
@@ -62,6 +63,12 @@ Add this line to the end of the file. This gives the deploy user "sudo without p
deploy ALL=NOPASSWD: ALL
+Upload your SSH keys:
+
+ cap ssh:setup
+
+(Just answer no to the first question if you already have local keys generated.)
+
Set up your fresh Debian server
-------------------------------
@@ -70,6 +77,8 @@ Set up your fresh Debian server
cap debian:setup
+(See **config/cookbook/recipes/debian.rb**. You might want to run the tasks individually to know what's going on.)
+
### On the server
Its probably a good idea to restart the server after all that:
@@ -82,15 +91,30 @@ Deploy your app
### First deploy
- cap mysql:create:user
- cap mysql:create:db
cap deploy:create
+
+(See **config/cookbook/recipes/deploy.rb** to know what's going on here.)
+
+Optionally set up log rotation and a monit entry for your mongrels:
+
+ cap log:rotate
+ cap monit:config:mongrel
### Subsequent deploys
cap deploy
+Deploy staging
+--------------
+
+See *Deploy your app*, but replace `cap` with `cap staging`.
+
+Example:
+
+ cap staging deploy:create
+
+
Set up a PHP app
----------------
View
@@ -4,8 +4,8 @@
desc "Configure and install a fresh Debian server"
task :default do
if yes("Have you created the user defined in config/deploy.rb? (See vendor/plugins/cookbook/README)")
- debian.config.default
debian.aptitude.default
+ debian.config.default
debian.install.default
end
end
@@ -123,7 +123,7 @@
end
end
- desc "Install Lighttpd"
+ desc "Install Lighttpd" # Lighttpd install is purely for spawn-fcgi
task :lighttpd, :roles => :app do
sudo_puts 'aptitude install libpcre3-dev libbz2-dev -q -y'
install_source(:lighttpd) do |path|
@@ -134,6 +134,7 @@
desc 'Install Monit'
task :monit, :roles => :db do
sudo_puts 'aptitude install monit -q -y'
+ monit.config.default
end
desc 'Install MySQL'
@@ -146,6 +147,7 @@
"See http://dev.mysql.com/doc/refman/5.1/en/mysql-secure-installation.html",
''
].join("\n")
+ ROOT.mysql.create.user
end
desc 'Install Nginx'
View
@@ -18,9 +18,10 @@
desc "Deploy a fresh app"
task :create, :roles => :app do
+ mysql.create.db
sudo_each [
"mkdir -p #{base_dir}",
- "chown -R mongrel:mongrel #{base_dir}"
+ "chown -R #{user}:#{user} #{base_dir}"
]
deploy.setup
if platform == :rails
@@ -42,6 +43,7 @@
sudo "rm -Rf #{deploy_to}"
nginx.config.destroy
nginx.restart
+ mysql.destroy.db
end
end
View
@@ -15,6 +15,7 @@
'/etc/monit/monitrc',
'/etc/default/monit'
], binding, :chown => 'root', :chmod => '0644', :folder => 'monit'
+ monit.config.nginx
end
desc "Add mongrel cluster to monitrc"

0 comments on commit e437f7a

Please sign in to comment.