Working examples of a rails stack?

17 views
Skip to first unread message

Emil Tin

unread,
Apr 21, 2009, 11:22:32 AM4/21/09
to poolp...@googlegroups.com

Are there any working examples of a clouds.rb file for an apache/
passenger/rails/mysql stack? I've looked at the files in the examples
folder, but I have a hard time figuring out how to proceed.

Is it correct that often the same thing can be achieved using either a
pp plugins or a chef recipe? (Like setting up apache2.) What's the
preferred way?

Based on the file examples/fairchild.rb in the poolparty git repo i
created the following clouds.rb file. (btw i had to fix a syntax error
in the has_git_repos declaration.) The folder ~/cookbooks/ was git
cloned from the opscode cookbook git repo. I can start the cloud, but
it seems apache is not running:

root@ip-10-251-74-150:~# curl http://localhost
curl: (7) couldn't connect to host

#cloud.rb:

pool :mypool do
keypair "~/.ec2/testpair"
cloud :mycloud do
instances 1

has_directory "/var/www"

has_git_repos "paparazzi",
:source => "git://github.com/auser/paparazzi.git",
:at => "/var/www"

chef do
# include_recipes "~/cookbooks/*"
recipe "#{File.dirname(__FILE__)}/examples/fairchild_chef.rb"
end

end
end

#examples/fairchild_chef.rb:

include_recipe "apache2"
include_recipe "passenger"
include_recipe "rails"
include_recipe "git"
include_recipe "ec2"
include_recipe "sqlite"

web_app "paparazzi" do
docroot "/var/www/paparazzi/public"
template "paparazzi.conf.erb"
server_name "www.paparazzi.com"
server_aliases [node[:hostname], node[:fqdn], "paparazzi.com"]
rails_env "production"
end


Ari Lerner

unread,
Apr 21, 2009, 1:09:04 PM4/21/09
to poolp...@googlegroups.com
Emil,

Try running cloud configure again (this is a known problem we're
working on fixing). If you run it again, does apache2 start?

Ari
Reply all
Reply to author
Forward
0 new messages