Skip to content
leibowitz edited this page Mar 13, 2013 · 28 revisions

Requirements

  • PHP >= 5.3
  • MongoDB >= 2.2
  • Python
  • Apache2, Nginx or any webserver
  • RabbitMQ
  • PhantomJS >= 1.5

Optional

  • Supervisor

Installation

The easiest way to install is to use chef. This will install all the components for you and supports multiple distributions.

Install librarian-chef

sudo apt-get install ruby
sudo gem install chef librarian

Create Cheffile

site 'http://community.opscode.com/api/v1'

cookbook 'chef-client'

cookbook 'apache2', '>= 1.0.0'
cookbook 'git'
cookbook 'rvm',
   :git => 'https://github.com/fnichol/chef-rvm'
cookbook 'php'
cookbook 'composer'
cookbook 'rabbitmq'
cookbook 'mongodb-10gen'
cookbook 'python'
cookbook 'supervisor'
cookbook 'phantomjs'

Librarian Chef

Use librarian-chef to download all cookbooks on your machine.

librarian-chef update

You are ready to use these recipes with with whatever you choose, for example with Vagrant.

sudo apt-get install vagrant
vagrant box add quantal64 http://cloud-images.ubuntu.com/quantal/current/quantal-server-cloudimg-vagrant-amd64-disk1.box
vagrant init quantal64

Copy this to a file called Vagrantfile

Vagrant::Config.run do |config|
  # Setup the box
  config.vm.define :perf do |perf_config|
      perf_config.vm.box = "quantal64"
      perf_config.vm.forward_port 80, 4567
      perf_config.vm.network :hostonly, "10.0.0.5"
      perf_config.vm.provision :chef_solo do |chef|
      chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
         # chef.roles_path = "roles"
         # chef.data_bags_path = "data_bags"
         chef.add_recipe "php"
         chef.add_recipe "apache2"
         chef.add_recipe "apache2::mod_php5"
         chef.add_recipe "python"
         chef.add_recipe "mongodb-10gen"
         chef.add_recipe "mongodb-10gen::single"
         chef.add_recipe "rabbitmq"
         chef.add_recipe "supervisor"
         chef.add_recipe "git"
         chef.add_recipe "composer"
         chef.add_recipe "phantomjs"
         chef.add_recipe "php-mongo"
         chef.add_recipe "python-libs"
      end
  end
end

The last two lines, php-mongo and python-libs, refers to two custom recipes. You will need to place the file instead the site-cookbooks directory yourself:

site-cookbooks/php-mongo/recipes/default.rb

php_pear "mongo" do
          action :install
end 

site-cookbooks/python-libs/recipes/default.rb

python_pip "pika" do
    action :install
end

python_pip "pymongo" do
    action :install
end

Now you are all set to spawn your box.

Clone this wiki locally