Skip to content

Varying Vagrant Vagrants is an evolving Vagrant configuration focused on WordPress development.

Notifications You must be signed in to change notification settings

thewebists/VVV

 
 

Repository files navigation

Varying Vagrant Vagrants

Varying Vagrant Vagrants is an evolving Vagrant configuration focused on WordPress development.

VVV is a 10up creation and transitioned to a community organization in 2014.

Overview

The Purpose of Varying Vagrant Vagrants

The primary goal of Varying Vagrant Vagrants (VVV) is to provide an approachable way for developers to begin working in a development environment that matches a production environment as closely as possible.

The default server configuration provisioned by VVV is intended to match a common configuration for working with high traffic WordPress sites.

The default WordPress configurations provided by VVV are intended to create an environment ideal for developing themes and plugins as well as for contributing to WordPress core.

How to Use Varying Vagrant Vagrants

VVV as a MAMP/XAMPP Replacement

VVV is ready to use as is. Download or clone VVV and then type vagrant up to automatically build a sandboxed Ubuntu server on your computer containing everything needed to contribute to WordPress core or develop a WordPress theme or plugin.

Multiple projects can be developed at once in the same environment.

  • Use the wordpress-develop directory to participate in WordPress core development.
  • Use wp-content/themes in either the wordpress-default or wordpress-trunk directories to develop multiple themes.
  • Use wp-content/plugins in either the wordpress-default or wordpress-trunk directories to develop plugins.
  • Take advantage of VVV's auto site configuration to provision additional instances of WordPress in /srv/www/.

VVV as a Scaffold

Entirely different server configurations can be created by modifying the files included with VVV and through the use of additional Auto Site Setup provisioning scripts.

It is not necessary to track the changes made to the main repository. Feel free to check this project out and then change everything to make it your own.

The Future of Varying Vagrant Vagrants

Immediate goals for VVV include:

  • Continue to work towards a stable state of software and configuration included in the default provisioning.
  • Provide excellent and clear documentation throughout VVV to aid in both learning and scaffolding.

Getting Started

What is Vagrant?

Vagrant is a "tool for building and distributing development environments". It works with virtualization software such as VirtualBox to provide a virtual machine that is sandboxed away from your local environment.

The First Vagrant Up

  1. Start with any operating system.
  2. Install VirtualBox 4.3.10
    • VVV is completely compatible with earlier versions of VirtualBox, so 4.2.22 or earlier would be just fine. Do note that Vagrant had specific issues with 4.2.16. Going as far back as 4.2.10 will likely be of no issue.
    • VVV itself leans in the 4.3.x direction in the master branch to stay ahead of the curve.
  3. Install Vagrant 1.5.4
    • vagrant will now be available as a command in your terminal, try it out.
    • Note: If Vagrant is already installed, use vagrant -v to check the version. You may want to consider upgrading if a much older version is in use.
    • Note: If VirtualBox 4.3.x is installed, Vagrant 1.3.5 or later is required.
  4. Install the vagrant-hostsupdater plugin with vagrant plugin install vagrant-hostsupdater
    • Note: This step is not a requirement, though it does make the process of starting up a virtual machine nicer by automating the entries needed in your local machine's hosts file to access the provisioned VVV domains in your browser.
    • If you choose not to install this plugin, a manual entry should be added to your local hosts file that looks like this: 192.168.50.4 vvv.dev local.wordpress.dev local.wordpress-trunk.dev src.wordpress-develop.dev build.wordpress-develop.dev
  5. Install the vagrant-triggers plugin with vagrant plugin install vagrant-triggers
    • Note: This step is not a requirement. It does allow for various scripts to fire when issuing commands such as vagrant halt and vagrant destroy.
    • By default, if vagrant-triggers is installed, a db_backup script will run on halt, suspend, and destroy that backs up each database to a dbname.sql file in the {vvv}/database/backups/ directory. These will then be imported automatically if starting from scratch. Custom scripts can be added to override this default behavior.
  6. Clone or extract the Varying Vagrant Vagrants project into a local directory
    • git clone git://github.com/Varying-Vagrant-Vagrants/VVV.git vagrant-local
    • OR download and extract the repository master zip file
    • OR grab a stable release if you'd like some extra comfort.
  7. Change into the new directory with cd vagrant-local
  8. Start the Vagrant environment with vagrant up
    • Be patient as the magic happens. This could take a while on the first run as your local machine downloads the required files.
    • Watch as the script ends, as an administrator or su password may be required to properly modify the hosts file on your local machine.
  9. Visit any of the following default sites in your browser:

Fancy, yeah?

What Did That Do?

The first time you run vagrant up, a packaged box containing a basic virtual machine is downloaded to your local machine and cached for future use. The file used by Varying Vagrant Vagrants contains an installation of Ubuntu 14.04 and is about 332MB.

After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the provisioning script included with VVV. This initiates the download and installation of around 100MB of packages on the new virtual machine.

The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely only take several minutes.

On future runs of vagrant up, the packaged box will be cached on your local machine and Vagrant will only need to apply the requested provisioning.

  • Preferred: If the virtual machine has been powered off with vagrant halt, vagrant up will quickly power on the machine without provisioning.
  • Rare: If you would like to reapply the provisioning scripts with vagrant up --provision or vagrant provision, some time will be taken to check for updates and packages that have not been installed.
  • Very Rare: If the virtual machine has been destroyed with vagrant destroy, it will need to download the full 100MB of package data on the next vagrant up.

Now What?

Now that you're up and running, start poking around and modifying things.

  1. Access the server via the command line with vagrant ssh from your vagrant-local directory. You can do almost anything you would do with a standard Ubuntu installation on a full server.
    • MS Windows users: An SSH client is generally not distributed with Windows PCs by default. However, a terminal emulator such as PuTTY will provide access immediately. For detailed instructions on connecting with PuTTY, consult the VVV Wiki.
  2. Power off the box with vagrant halt and turn it back on with vagrant up.
  3. Suspend the box's state in memory with vagrant suspend and bring it right back with vagrant resume.
  4. Reapply provisioning to a running box with vagrant provision.
  5. Destroy the box with vagrant destroy. Files added in the www directory will persist on the next vagrant up.
  6. Start modifying and adding local files to fit your needs. Take a look at Auto Site Setup for tips on adding new projects.

Caveats

The network configuration picks an IP of 192.168.50.4. This works if you are not on the 192.168.50.x sub domain, it could cause conflicts on your existing network if you are on a 192.168.50.x sub domain already. You can configure any IP address in the Vagrantfile and it will be used on the next vagrant up

Credentials and Such

All database usernames and passwords for WordPress installations included by default are wp and wp.

All WordPress admin usernames and passwords for WordPress installations included by default are admin and password.

WordPress Stable

  • URL: http://local.wordpress.dev
  • DB Name: wordpress_default

WordPress Trunk

  • URL: http://local.wordpress-trunk.dev
  • DB Name: wordpress_trunk

WordPress Develop

  • /src URL: http://src.wordpress-develop.dev
  • /build URL: http://build.wordpress-develop.dev
  • DB Name: wordpress_develop
  • DB Name: wordpress_unit_tests

MySQL Root

What do you get?

A bunch of stuff!

  1. Ubuntu 14.04 LTS (Trusty Tahr)
  2. WordPress Develop
  3. WordPress Stable
  4. WordPress Trunk
  5. WP-CLI
  6. nginx 1.6.x
  7. mysql 5.5.x
  8. php-fpm 5.5.x
  9. memcached 1.4.13
  10. PHP memcache extension 3.0.8
  11. PHP xdebug extension 2.2.5
  12. PHP imagick extension 3.1.2
  13. PHPUnit 4.0.x
  14. ack-grep 2.04
  15. git 1.9.x
  16. subversion 1.8.x
  17. ngrep
  18. dos2unix
  19. Composer
  20. phpMemcachedAdmin
  21. phpMyAdmin 4.1.14 (multi-language)
  22. Opcache Status
  23. Webgrind
  24. NodeJs Current Stable Version
  25. grunt-cli Current Stable Version

Need Help?

  • Let us have it! Don't hesitate to open a new issue on GitHub if you run into trouble or have any tips that we need to know.
  • The WordPress and Vagrant Mailing list is a great place to get started for any related topics.
  • The VVV Wiki also contains documentation that may help.

Common Caveats

These are common to Vagrant environments and worth noting:

  • If the directory VVV is inside of is moved once provisioned, it may break.
    • If vagrant destroy is used before moving, this should be fine.
  • If Virtualbox is uninstalled, VVV will break.
  • If Vagrant is uninstalled, VVV will break.

History

VVV has come a long way since it was first launched as Varying Vagrant Vagrants in December of 2012. Initially introduced as an exploration of workflow for immediate project needs at 10up, VVV caught speed quickly as more and more of the team was introduced. During an internal 10up developer summit in March of 2013, Vagrant as a tool was a highlight and more developers made the conversion.

In April of 2013, we made a call to the WordPress community to try to encourage the addition of Vagrant to everyday life. These efforts continued with talks at WordCamp Chicago, WordCamp Vancouver, and WordCamp Denver.

In January of 2014, 10up made the decision to spin VVV off into its own organization to better align with the community that has grown around the project over time. This transition opens doors for what Varying Vagrant Vagrants, the organization can accomplish as an ongoing project.

About

Varying Vagrant Vagrants is an evolving Vagrant configuration focused on WordPress development.

Resources

Stars

Watchers

Forks

Packages

No packages published