Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant Basics

Vagrant Basics

A vagrant presentation

Krishna Halaharvi

January 23, 2014
Tweet

More Decks by Krishna Halaharvi

Other Decks in Programming

Transcript

  1. A person without a settled home or regular work who

    wanders from place to place and lives by begging. Definition
  2. Why Vagrant? -Prior to vagrant -Install and configure all the

    software locally on your development machine -Set it and forget it PHP and mySQL -Easy to configure -Reproducible -Portable
  3. Today -A lot of moving parts -Options for underlying technologies

    -Javascript, Python, Ruby -Web Servers: Apache, Nginx, Unicorn, Thin, RabbitMQ, Solr
  4. One Command Many Benefits -Create a VM of an OS

    of your choice -Modify physical properties of this VM -Establish network interfaces -Set shared folders -Boot up the VM to set it to run -Set the hostname of VM -Provision software on VM -Performs host and guest specific tweaking.
  5. Boxes -Building a VM from scratch is resource- intensive and

    time consuming -Vagrant uses a base image clones it to rapidly create a usable machine -Boxes are added to vagrant by running -$vagrant box add “name” “location”
  6. Provisioning and Networking Simply add this to the vagrantfile and

    set up the shell script to install your webserver: config.vm.provision :shell, :path => “bootstrap.sh” Port forwarding: config.vm.network :forwarded_port, host: 3000, guest: 80
  7. Multi-Machine -Vagrant can control multiple guest machines per vagrantfile -Seperate

    a web and database server -Model a distributed system -Disaster case testing