Using VVV is pretty great. Having a starting point for any new projects you bring under the VVV tool-set is a great way to enhance your productivity.
Once this command runs, it will create an ./htdocs
directory in the current working directory if this directory doesn't exist. This ./htdocs
directory is used by VVV to serve WordPress. If you are tracking the whole project, you should create a Git repo within the ./htdocs
directory. If you are only tracking the theme, you can clone your custom theme, within the ./htdocs/wp-content/themes
directory.
$ cd ./htdocs
$ git init
$ cd ./htdocs/wp-content/themes/
$ git clone git@github.com/user/theme-repo ./theme-wp
Documentation on VVV can be found here. More information about the files described below can be found here.
Copy the boilerplate directory you want to use to $VVV_ROOT/www
and update it's name appropriately. Once that directory has been copied to the www
directory, you will have to update all of the files to reference your new site. The files that need to be updated are referenced below for each WordPress site.
One these files are updated, simply run vagrant reload --provision
to provision your VM with the latest contents of www
. If you simply provision the box, you will need to update your /etc/hosts
file manually as the vagrant hooks only run on up/reload.
./single-site
├── vvv-hosts
├── vvv-init.sh
└── vvv-nginx.conf
vvv-hosts
contains the /etc/hosts entries which will allow VVV to add them to your /etc/hosts file.- Update the line that references
project.dev
to point to the URL you would like for your site to use in the browser. Remember this URL as you will be referencing it in the other files as well.
- Update the line that references
vvv-init.sh
is the provisioning script for this specific WP installation.- Update the three variables:
WP_DB_NAME
WP_BASE_URL
(Same as the first line of yourvvv-hosts
file)WP_BASE_TITLE
- Make sure to update any other variables that you may need to tweak if you are migrating a project from production to local. Otherwise, you should be safe with the defaults in the boilerplate.
- Update the three variables:
vvv-nginx.conf
is the server-configuration block for the ngnix server running in the VM.- Update
server_name
to the same contents of the first line of yourvvv-hosts
file.
- Update
./subdirectories-multi-site
├── vvv-hosts
├── vvv-init.sh
└── vvv-nginx.conf
vvv-hosts
contains the /etc/hosts entries which will allow VVV to add them to your /etc/hosts file.- Update the line that references
multiproject.dev
to point to the URL you would like for your site to use in the browser. Remember this URL as you will be referencing it in the other files as well. - Also update the rest of the lines to use a subdomain remembering to include the domain and TLD for your site. Caveat: Even though this is a subdirectory WordPress Multisite the
vvv-init.sh
script expects the subdomains to exist in order to create your sites in the WordPress Multisite Network.
- Update the line that references
vvv-init.sh
is the provisioning script for this specific WP installation.- Update the three variables:
WP_DB_NAME
WP_BASE_URL
(Same as the first line of yourvvv-hosts
file)WP_BASE_TITLE
- Make sure to update any other variables that you may need to tweak if you are migrating a project from production to local. Otherwise, you should be safe with the defaults in the boilerplate.
- Update the three variables:
vvv-nginx.conf
is the server-configuration block for the ngnix server running in the VM.- Update
server_name
to the same contents of the first line of yourvvv-hosts
file.
- Update
./subdomains-multi-site
├── vvv-hosts
├── vvv-init.sh
└── vvv-nginx.conf
vvv-hosts
contains the /etc/hosts entries which will allow VVV to add them to your /etc/hosts file.- Update the line that references
multiproject.dev
to point to the URL you would like for your site to use in the browser. Remember this URL as you will be referencing it in the other files as well. - Also update the rest of the lines to use a subdomain remembering to include the domain and TLD for your site.
- Update the line that references
vvv-init.sh
is the provisioning script for this specific WP installation.- Update the three variables:
WP_DB_NAME
WP_BASE_URL
(Same as the first line of yourvvv-hosts
file)WP_BASE_TITLE
- Make sure to update any other variables that you may need to tweak if you are migrating a project from production to local. Otherwise, you should be safe with the defaults in the boilerplate.
- Update the three variables:
vvv-nginx.conf
is the server-configuration block for the ngnix server running in the VM.- Update
server_name
to the same contents of the first line of yourvvv-hosts
file. Remember to include the leading.
character in theserver_name
to capture subdomains
- Update