/devmachine

Primary LanguageShell

This is a folk from https://github.com/ezekg/theme-juice-basebox, most of the text from this Readme is taken directly from this Git Repository. However I have added the Phusion Passenger Library

Getting Started

What is Vagrant?

Vagrant is a "tool for building and distributing development environments".

Installation

Run the commands below from whatever directory you want the VM installed:

# First, cd to where you want to install the VM, then run...
git clone git@bitbucket.org:tanzy/vagrant-dev-machine.git .
vagrant up

What do you get?

Name Version Description
Ubuntu 14.04 Ubuntu is a Debian-based Linux operating system and distribution for personal computers, smartphones and network servers.
Apache 2.4.x The Apache HTTP Server, colloquially called Apache, is the world's most used web server software.
PHP 5.5.x PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
PHPBrew stable PHPBrew allows you to easily switch PHP versions.
MySQL 5.5.x MySQL is an open-source relational database management system.
WP-CLI stable WP-CLI is a set of command-line tools for managing WordPress installations.
Composer stable Composer is a dependency manager for PHP.
NVM stable NVM allows you to easily switch Node.js versions.
Node.js stable Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
npm stable npm is a dependency manager for Node.js.
sympm stable sympm allows you to run npm install from inside of a Vagrant virtual machine without hitting symlink issues.
Grunt stable Grunt is a task runner for JavaScript.
RVM stable RVM allows you to easily switch Ruby versions.
Ruby stable Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
Ruby Gems stable RubyGems.org is the Ruby community’s gem hosting service.
Bundler stable Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.
Xdebug 2.2.x Xdebug is a PHP extension which provides debugging and profiling capabilities.
Webgrind stable Webgrind is an Xdebug profiling web frontend in PHP.
Memcached 1.4.x Memcached (pronunciation: mem-cash-dee) is a general-purpose distributed memory caching system.
phpMemcachedAdmin 1.2.x phpMemcachedAdmin is an administration panel for Memcached for monitoring and debugging purposes.
phpMyAdmin 4.0.x phpMyAdmin is a tool written in PHP, intended to handle the administration of MySQL over the Web.
ack 2.14.x ack is a tool like grep, optimized for programmers.
xo stable xo is a command line utility that takes an input string from stdin and formats the regexp matches.
git 1.8.x Git is a widely used source code management system for software development. It is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.
ngrep 1.45.x ngrep (network grep) is a network packet analyzer.
dos2unix 6.0.x dos2unix converts text files with DOS or Mac line endings to Unix line endings and vice versa.
passenger stable Phusion Passenger for running Node & Ruby in Apache
elasticsearch 2.0 Elasticsearch
RabbitMq stable RabbitMq login on using Vagrant Vagrant
                                                                                                                                                                                                     |   

Dashboard

You can view things such as a PHP phpinfo() dump, phpMemcachedAdmin, phpMyAdmin, Webgrind and more through the main dashboard.

Switching PHP versions

Create a new file called provision/provision-post.sh and add the PHP version you would like to use, making sure it contains all 3 parts (i.e. x.x.x). See the following example:

#!/bin/bash
php-switch 5.6.18 -y # -y skips all prompts

After that, provision the VM with vagrant provision. Bam! That easy!

Alternatively, you can vagrant ssh into the VM and run, for example,

php-switch 5.6.18

Using php-switch over SSH doesn't require you to provision the VM, so in the end it is a lot faster. If you'd like to permanently use a specific PHP version, you should use the provision-post.sh method, as that will persist even if the VM is destroyed and re-created.

_Currently, this feature is limited to only PHP 5.x.

Automatically generated self-signed SSL certs

When a conf file within config/apache-config/sites/ contains a virtual host with a *:443 port number, a self-signed SSL certificate will automatically be generated on the next provision. For example, a virtual host that looks like this,

<VirtualHost *:80>
  DocumentRoot /srv/www/tj-example
  ServerName example.dev
</VirtualHost>

<VirtualHost *:443>
  DocumentRoot /srv/www/tj-example
  ServerName example.dev
  SSLEngine on
  SSLCertificateFile "/etc/ssl/certs/example.dev.pem"
  SSLCertificateKeyFile "/etc/ssl/private/example.dev.key"
</VirtualHost>

will automatically get a generated certificate when provisioned. Once a site has a certificate, another one will not be generated until the old one is removed.

Accepting a self-signed SSL cert

OS X Instructions

Since it's a little unintuitive, I'll link you off to this great tutorial on accepting a self-signed cert.

You may need to restart your browser to see this change take effect.

Windows Instructions

Know how? Create a pull request!

Linux Instructions

Know how? Create a pull request!

Credentials and Such

Program User Pass Dashboard
MySQL root root http://basebox.dev/database-admin/

Need Help?

  • Let us have it! Don't hesitate to open a new issue if you run into trouble or have any tips that we need to know.