Share
Embed
But It Works on My Machine
An introduction using Virtual Machines for local development, presented at EECI 2012.
Stephen Lewis
May 30, 2012
Transcript
44 slides
-
EECI 2012 : But It Works On My Machine But
It Works On My Machine Stephen Lewis http://experienceinternet.co.uk @monooso -
EECI 2012 : But It Works On My Machine /
Virtual Machines What’s Your Problem? -
EECI 2012 : But It Works On My Machine /
What's Your Problem? Can You Believe This Shit? -
EECI 2012 : But It Works On My Machine /
What's Your Problem? Let’s Dance With Low! -
EECI 2012 : But It Works On My Machine /
Episode One / Sub-section The Problem • Working on multiple sites in parallel • Each site has different technological requirements -
EECI 2012 : But It Works On My Machine /
Episode One / Sub-section -
EECI 2012 : But It Works On My Machine /
What’s Your Problem? The local “server” mirrors the live server Each project is self-contained, and sandboxed The entire team has an identical setup The entire team has an up-to-date setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup -
EECI 2012 : But It Works On My Machine /
Virtual Machines Rise of the Virtual Machines -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Features and Benefits A virtual machine is a fully- featured, self-contained, sandboxed OS, running inside your OS. -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Benefits A virtual machine is a fully- featured, self-contained, sandboxed OS, running inside your OS. fully- featured EECI 2012 : But It Works On My Machine / Virtual Machines / Features and Benefits -
The local “server” mirrors the live server Each project is
self-contained, and sandboxed The entire team has an identical setup The entire team has an up-to-date setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup The local “server” mirrors the live server EECI 2012 : But It Works On My Machine / Virtual Machines / Features and Benefits -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Benefits A virtual machine is a fully- featured, self-contained, sandboxed OS, running inside your OS. fully- featured self-contained, sandboxed EECI 2012 : But It Works On My Machine / Virtual Machines / Features and Benefits -
The local “server” mirrors the live server Each project is
self-contained, and sandboxed The entire team has an identical setup The entire team has an up-to-date setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup Each project is self-contained, and sandboxed The entire team has an identical setup Remote and mobile workers are supported The entire team has an up-to-date setup EECI 2012 : But It Works On My Machine / Virtual Machines / Features and Benefits The local “server” mirrors the live server -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Features and Benefits Snapshot Clone -
The local “server” mirrors the live server Each project is
self-contained, and sandboxed The entire team has an identical setup The entire team has an up-to-date setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup Each project is self-contained, and sandboxed The local “server” mirrors the live server The entire team has an identical setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup The entire team has an up-to-date setup EECI 2012 : But It Works On My Machine / Virtual Machines / Benefits -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine Building Your First Virtual Machine -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine Building Your First VM 1. Download ISO image of desired OS 2. Create and configure new VM in VirtualBox 3. Install VM operating system from ISO image 4. Configure development site -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 1 Step 1: Download OS ISO Image -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 1 http://ubuntu.com/download/server -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 1 http://virtualboxes.org -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 2 Step 2: Create & Configure VM in VirtualBox -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 3 Step 3: Install VM OS from ISO Image -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 3 -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 4 Step 4: Configure Development Site -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 4 Update the apt index Update any installed apt bundles Install the VirtualBox "Guest Additions" package, to enable shared folders Give Apache and your user account read / write permissions on VirtualBox shared folders Configure Apache's httpd.conf, to ensure Apache sends fresh files. Configure Apache's Virtual Hosts. Enable your new site, and disable the "default" site Secure MySQL Install phpMyAdmin Install the PHP5 cURL extension Enable the expires, headers, and rewrite Apache modules Install, enable, and configure XDebug Configure the location of PHP’s log files -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Step 4 https://github.com/experience/vm-config -
EECI 2012 : But It Works On My Machine /
Virtual Machines / Building a Virtual Machine / Demo Demo -
The local “server” mirrors the live server Each project is
self-contained, and sandboxed The entire team has an identical setup The entire team has an up-to-date setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup Each project is self-contained, and sandboxed EECI 2012 : But It Works On My Machine / Virtual Machines / Benefits The local “server” mirrors the live server The entire team has an identical setup Remote and mobile workers are supported It’s easy to start a new project based on a “standard” setup The entire team has an up-to-date setup -
EECI 2012 : But It Works On My Machine /
Vagrant Vagrant ? -
EECI 2012 : But It Works On My Machine /
Vagrant / Definition Vagrant lets you create and configure lightweight, reproducible, and portable development environments. -
EECI 2012 : But It Works On My Machine /
Vagrant / Advantages Advantages • Distribute scripts, not a monolithic VM file • Keep server config scripts in version control • Simple, declarative configuration syntax • Mix and match scripts • Provision multiple servers -
EECI 2012 : But It Works On My Machine /
Vagrant / How It Works VirtualBox Puppet or Chef Vagrant Base box (hardware and software) Provisioning and configuration $> vagrant up -
EECI 2012 : But It Works On My Machine /
Vagrant / Puppet user {'joel': ensure => present, gid => 'ewok', home => '/home/endor', } -
EECI 2012 : But It Works On My Machine /
Episode One / Sub-section Puppet Resource Types • cron • file • host • notify • package • ssh_authorized_key • service • user • ...and 40 others -
EECI 2012 : But It Works On My Machine /
Vagrant / Puppet / Examples package {'apache2': ensure => present, } file {'httpd.conf': path => '/etc/apache2/httpd.conf', require => Package['apache2'], source => template('httpd.conf.erb'), } service {'apache2': running => true, subscribe => File['httpd.conf'], } -
EECI 2012 : But It Works On My Machine /
Vagrant / Puppet / Examples # httpd.conf.erb <VirtualHost *:80> DocumentRoot /media/sf_devsite ServerName <%= @fqdn %> </VirtualHost> -
EECI 2012 : But It Works On My Machine /
Vagrant / Puppet / Examples # Generated httpd.conf <VirtualHost *:80> DocumentRoot /media/sf_devsite ServerName thingsthatlooklikejoel.dev </VirtualHost> -
EECI 2012 : But It Works On My Machine /
Vagrant / When To Use Use Vagrant If You... • Need to provision a server from scratch • Have complex server configuration requirements • Need to provision multiple identical servers -
EECI 2012 : But It Works On My Machine /
Vagrant / Resources Resources vagrantup.com docs.puppetlabs.com/puppet wiki.opscode.com/display/chef/Home -
EECI 2012 : But It Works On My Machine /
Conclusion Conclusion -
EECI 2012 : But It Works On My Machine /
Thank You Thank You Find me at: experienceinternet.co.uk github.com/experience @monooso [email protected] -
EECI 2012 : But It Works On My Machine /
Questions? Questions? Find me at: experienceinternet.co.uk github.com/experience @monooso [email protected]