SlideShare a Scribd company logo
1 of 15
Download to read offline
Quick & Easy Dev Environments with
             Vagrant
             MemphisPHP.org
                3/26/13



 Tonight's Sponsor:
About Vagrant

"Vagrant is a tool for building complete
development environments. With an easy-to-
use workflow and focus on automation, Vagrant
lowers development environment setup time,
increases development/production parity, and
makes the "works on my machine" excuse a
relic of the past."
-http://www.vagrantup.com/about.html
What can Vagrant do for me?

● Easily create environments without waiting
  for an Operating system install
● Easily configure pre-built boxes or build your
  own
● Share packaged environments with
  coworkers or a team of developers
● Ensures everyone is developing against the
  same target environment.
● Portable - move environments from machine
  to machine
Let's get started

Install Virtualbox
Install Vagrant (Windows users may need to restart after)
Start an admin command line
enter 'vagrant -v' in the command line.

Aquire a vagrant box http://www.vagrantbox.es/

'vagrant box add box_name URL/Path'
Create a project folder
'mkdir vagrant-memphisphp'
'cd vagrant-memphisphp'
'vagrant init'

A file Vagrantfile is created, edit this file and
change the value of config.vm.box to the name
of the box you added earlier.
Configure network / ports
uncomment the config.vm.network line and lets
set up port 9000 to forward to port 80 on the
VM

config.vm.network :forwarded_port, guest: 80,
host: 9000
Fire up the VM!

Simply run 'vagrant up'

Once the command has finished, the box will
be running in the background.

Now we need to configure ssh so we can
remote into the box.

'vagrant ssh'
SSH + Windows = Putty+ PuttyGen

On windows, this will give a warning that it cannot find an
executable 'ssh'. What we need to do here is open putty,
configure 127.0.0.1:2222 with the private key it generated
here: C:/Users/halo/.vagrant.d/insecure_private_key

You will need to use Puttygen to generate the key for putty
to use. The user name will be 'vagrant'
Lamp Config! - http://pastebin.com/dFtidcrF
#!/bin/bash
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y--enablerepo=remi,remi-test install httpd mysql mysql-server php php-common
yum -y--enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-
memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-
pear php-pdo
chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on
/etc/init.d/httpd start
/etc/init.d/mysqld start
/usr/bin/mysqladmin -u root password 'vagrant'
/usr/bin/mysqladmin -u root -h localhost password 'vagrant'
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT
service iptables save
yum -y --enablerepo=remi,remi-test install phpmyadmin git
Post Lamp config...

Once this script completes you should be able
to view http://localhost:9000/ and see the
default CentOS apache page.
Shared Folders

By default vagrant shares the project directory
with the guest VM mounted at /vagrant You can
add your own shares via the Vagrantfile.
Shutting Down / Reloading

When you need to shut down or halt the VM
you can simply use 'vagrant halt'.

If you need to restart to reload the Vagrantfile
config, use 'vagrant reload'

You can also 'vagrant suspend' to suspend the
VM.
Destroy!

To completely wipe the VM you can 'vagrant
destroy'.

Then simply run 'vagrant up' again to reimport
the box and start over.
Sharing is caring... or something...

'vagrant package'
This will shutdown the VM and create a
distributable package of the VM to you can
share / deploy to a dev team.
C:Usershalovagrant-memphisphp>vagrant package
[default] Attempting graceful shutdown of VM...
[default] Clearing any previously set forwarded ports...
[default] Creating temporary directory for export...
[default] Exporting VM...
[default] Compressing package to: C:/Users/halo/vagrant-
memphisphp/package.box
Links & Further Reading

Vagrant: www.vagrantup.com
Vagrant Boxen:www.vagrantbox.es
CentOS: www.centos.org

More Related Content

What's hot

Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantJulien Barbier
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantFelipe
 
Tmux and Tmuxinator ~ Rise of the Machines
Tmux and Tmuxinator  ~ Rise of the MachinesTmux and Tmuxinator  ~ Rise of the Machines
Tmux and Tmuxinator ~ Rise of the MachinesBrian Loomis
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-OverviewCrifkin
 
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...Develcz
 
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...James Wickett
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용InHwan Chun
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleJordi Soucheiron
 
Vagrant. Halturin Artem
Vagrant. Halturin ArtemVagrant. Halturin Artem
Vagrant. Halturin ArtemADCI Solutions
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottleJordi Soucheiron
 
Vagrant for Development
Vagrant for DevelopmentVagrant for Development
Vagrant for DevelopmentJacky Chan
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environmentJeremy Quinton
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containersMarian Marinov
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 

What's hot (20)

Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using Vagrant
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Fabric
FabricFabric
Fabric
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
 
Tmux and Tmuxinator ~ Rise of the Machines
Tmux and Tmuxinator  ~ Rise of the MachinesTmux and Tmuxinator  ~ Rise of the Machines
Tmux and Tmuxinator ~ Rise of the Machines
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
 
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...
Dev Tooling for your Technohipster Startup using aws, docker, tmux, vim & ope...
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottle
 
Storm v0.2
Storm v0.2Storm v0.2
Storm v0.2
 
Vagrant. Halturin Artem
Vagrant. Halturin ArtemVagrant. Halturin Artem
Vagrant. Halturin Artem
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottle
 
Vagrant for Development
Vagrant for DevelopmentVagrant for Development
Vagrant for Development
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environment
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containers
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 

Similar to Quick & Easy Dev Environments with Vagrant

Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersSagar Acharya
 
ITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefOrtus Solutions, Corp
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101jelrikvh
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for realCodemotion
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantAntons Kranga
 
Cooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World TutorialCooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World TutorialDavid Golden
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de VagrantLeandro Nunes
 
Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Puppet
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 

Similar to Quick & Easy Dev Environments with Vagrant (20)

Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
ITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and Chef
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Cooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World TutorialCooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World Tutorial
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 

More from Joe Ferguson

Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Joe Ferguson
 
Modern infrastructure as code with ansible PyTN
Modern infrastructure as code with ansible  PyTNModern infrastructure as code with ansible  PyTN
Modern infrastructure as code with ansible PyTNJoe Ferguson
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sinkJoe Ferguson
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Joe Ferguson
 
DevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusDevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusJoe Ferguson
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis pythonJoe Ferguson
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementJoe Ferguson
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testingJoe Ferguson
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$Joe Ferguson
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Joe Ferguson
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:winConsole Apps: php artisan forthe:win
Console Apps: php artisan forthe:winJoe Ferguson
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...Joe Ferguson
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 Joe Ferguson
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Joe Ferguson
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialJoe Ferguson
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 

More from Joe Ferguson (20)

Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021
 
Modern infrastructure as code with ansible PyTN
Modern infrastructure as code with ansible  PyTNModern infrastructure as code with ansible  PyTN
Modern infrastructure as code with ansible PyTN
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™
 
DevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusDevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circus
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis python
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency Management
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testing
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:winConsole Apps: php artisan forthe:win
Console Apps: php artisan forthe:win
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Quick & Easy Dev Environments with Vagrant

  • 1. Quick & Easy Dev Environments with Vagrant MemphisPHP.org 3/26/13 Tonight's Sponsor:
  • 2. About Vagrant "Vagrant is a tool for building complete development environments. With an easy-to- use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past." -http://www.vagrantup.com/about.html
  • 3. What can Vagrant do for me? ● Easily create environments without waiting for an Operating system install ● Easily configure pre-built boxes or build your own ● Share packaged environments with coworkers or a team of developers ● Ensures everyone is developing against the same target environment. ● Portable - move environments from machine to machine
  • 4. Let's get started Install Virtualbox Install Vagrant (Windows users may need to restart after) Start an admin command line enter 'vagrant -v' in the command line. Aquire a vagrant box http://www.vagrantbox.es/ 'vagrant box add box_name URL/Path'
  • 5. Create a project folder 'mkdir vagrant-memphisphp' 'cd vagrant-memphisphp' 'vagrant init' A file Vagrantfile is created, edit this file and change the value of config.vm.box to the name of the box you added earlier.
  • 6. Configure network / ports uncomment the config.vm.network line and lets set up port 9000 to forward to port 80 on the VM config.vm.network :forwarded_port, guest: 80, host: 9000
  • 7. Fire up the VM! Simply run 'vagrant up' Once the command has finished, the box will be running in the background. Now we need to configure ssh so we can remote into the box. 'vagrant ssh'
  • 8. SSH + Windows = Putty+ PuttyGen On windows, this will give a warning that it cannot find an executable 'ssh'. What we need to do here is open putty, configure 127.0.0.1:2222 with the private key it generated here: C:/Users/halo/.vagrant.d/insecure_private_key You will need to use Puttygen to generate the key for putty to use. The user name will be 'vagrant'
  • 9. Lamp Config! - http://pastebin.com/dFtidcrF #!/bin/bash rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm yum -y--enablerepo=remi,remi-test install httpd mysql mysql-server php php-common yum -y--enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl- memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php- pear php-pdo chkconfig --levels 235 httpd on chkconfig --levels 235 mysqld on /etc/init.d/httpd start /etc/init.d/mysqld start /usr/bin/mysqladmin -u root password 'vagrant' /usr/bin/mysqladmin -u root -h localhost password 'vagrant' iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT service iptables save yum -y --enablerepo=remi,remi-test install phpmyadmin git
  • 10. Post Lamp config... Once this script completes you should be able to view http://localhost:9000/ and see the default CentOS apache page.
  • 11. Shared Folders By default vagrant shares the project directory with the guest VM mounted at /vagrant You can add your own shares via the Vagrantfile.
  • 12. Shutting Down / Reloading When you need to shut down or halt the VM you can simply use 'vagrant halt'. If you need to restart to reload the Vagrantfile config, use 'vagrant reload' You can also 'vagrant suspend' to suspend the VM.
  • 13. Destroy! To completely wipe the VM you can 'vagrant destroy'. Then simply run 'vagrant up' again to reimport the box and start over.
  • 14. Sharing is caring... or something... 'vagrant package' This will shutdown the VM and create a distributable package of the VM to you can share / deploy to a dev team. C:Usershalovagrant-memphisphp>vagrant package [default] Attempting graceful shutdown of VM... [default] Clearing any previously set forwarded ports... [default] Creating temporary directory for export... [default] Exporting VM... [default] Compressing package to: C:/Users/halo/vagrant- memphisphp/package.box
  • 15. Links & Further Reading Vagrant: www.vagrantup.com Vagrant Boxen:www.vagrantbox.es CentOS: www.centos.org