VCCW

Vagrant based development environment for WordPress plugins, themes, or websites.

View project onGitHub

Vagrant + Chef + WordPress

This is a Vagrant configuration designed for development of WordPress plugins, themes, or websites.

VCCW includes customizable variables for setting the WordPress version (or beta release), language, hostname, subdirectory, admin credentials, default plugins, default theme, multisite, SSL and other options. These variables give you a lot of flexibility in tailoring your development environment to your specific needs.

What's Installed

Requires

  • Vagrant 1.5 or later
  • VirtualBox 4.3 or later

Back to top

Getting Started

1. Install VirtualBox.

https://www.virtualbox.org/

2. Install Vagrant.

http://www.vagrantup.com/

3. Install the vagrant-hostsupdater plugin. (Optional)

$ vagrant plugin install vagrant-hostsupdater

Windows does not allow to change hosts files. Please add vccw.dev 192.168.33.10 by yourself!

4. Download vagrant box

$ vagrant box add miya0001/vccw

5. Please download .zip or .tar.gz.

Download.zip

6. Change into a new directory.

$ cd vccw-x.x.x

7. Start a Vagrant environment.

$ vagrant up

8. Visit WordPress on the Vagrant in your browser

Visit http://vccw.dev/ or http://192.168.33.10/

Back to top

Environments

WordPress

This tool installs a WordPress environment with these settings by default.

  • Default user
    • Username: admin
    • Password: admin

Database

  • MySQL Host: 127.0.0.1
  • Username: wordpress or root
  • Password: wordpress
  • Port: 3306

Default SSH

  • Host: vccw.dev or 192.168.33.10
  • Username: vagrant
  • Password: vagrant
  • Port: 22

You can login virtual machine with vagrant ssh.

Back to top

Customizing

VCCW is configured for those developing WordPress plugins, themes or websites. It includes many customizable variables for setting the WordPress version (or beta release), language, hostname, subdirectory, admin credentials, default plugins, default theme, multisite, SSL and other options. These variables give you a lot of flexibility in tailoring your development environment to your specific needs.

Copy provision/default.yml to site.yml like following.

$ cp provision/default.yml site.yml

Then edit the site.yml and run vagrant up.

Or place the site.yml and put variables like following.

hostname: example.com
lang: ja
plugins:
  - contact-form-7
  - jetpack

Then just run vagrant up.

Change PHP version

Put php version to site.yml like following.

php_version: 5.6.9

Then run vagrant up or vagrant provision.

See https://github.com/php-build/php-build/tree/master/share/php-build/definitions.

Global configuration

VCCW has a series of global parameters which work with all virtual machines.

They can be specified ~/.vccw/config.yml like following.

memory: 1024
cpus: 2
lang: ja
theme_unit_test: true

Customizable variables

See provision/default.yml.

Back to top

Run pre/post provisioning scripts

You can place shell scripts, so it will run at pre/post provisioning.

  • provision-pre.sh - Run before chef provisioning.
  • provision-post.sh - Run after chef provisioning.

Example shell script.

provision-post.sh - It will run after provisioning.

#!/usr/bin/env bash

set -ex

/usr/local/bin/wp --path=/var/www/wordpress plugin install contact-form-7 --activate

This example script will install and activate plugin "Contact Form 7" by WP-CLI.

Back to top

Checking Email with MailCatcher

MailCathcer re-routes all WordPress emails to Mailcatcher.

How to use

Run following command.

$ curl -L https://raw.githubusercontent.com/vccw-team/activate-mailcatcher/master/setup.sh | bash

Then visit http://vccw.dev:1080/.

Back to top

Changelog

https://github.com/vccw-team/vccw/releases

Back to top