A pretty basic Vagrant box running the following:
- LEMP stack
- Ubuntu 12.04 LTS 32-bit
- nginx
- MySQL
- PHP
- WordPress
- Bones
- Debug Bar (w/ Debug Bar Console)
- Install VirtualBox and Vagrant.
git clone git://github.com/boaf/posner.git && cd posner
vagrant up
- Add
10.10.10.10 dev.local
to/etc/hosts
- Visit
http://dev.local/
in yo browser to make sure everything works
There isn't much, but available within Vagrantfile
are...
Name | Default | ? |
---|---|---|
dev_host | dev.local | Local-accessible URL Must be entered in /etc/hosts |
dev_ip | 10.10.10.10 | Local-accessible IP address Good Idea™ to change this and dev_host if running multiple Vagrants |
wp_theme_name | wpdev | Theme dir name i.e. wp-content/themes/wpdev |
The WordPress installation by default will be in private mode. That is to
say that the option Discourage search engines from indexing this site
within
Settings › Reading is checked.
The following paths are linked between your local machine and the vagrant for convenience:
Local path | Vagrant path |
---|---|
setup/database/ | /srv/database/ |
setup/config/ | /srv/config/ |
nginx-logs/ | /srv/logs/ |
www/ | /srv/www/ |
- Within the Vagrant box
- User: root
- Password: blank (as in the word)
- Externally, without an SSH tunnel
- User: external
- Password: external
- Host: dev.local
- WP
- DB: wp
- User: wp
- Password: wp
- Admin User: wp
- Admin Password: wp (yes, everything is "wp")
vagrant halt
(bring it back up with vagrant up
)
It's possible to garner a pretty large list of running VMs if you remove
directories without first running vagrant destroy
, so it's a good idea to
sometimes run vboxmanage list vms
or vboxmanage list runningvms
to see where
you're at. Again, keep in mind that your VMs will not be removed until you run
vagrant destroy
(in the vagrant working directory) or manually delete the VM
from VirtualBox (former method preferred).
Thanks to the folks at 10up, for providing Varying Vagrant Vagrants (most of which this repo is based on). No copyright infringement intended!
The intended workflow with this setup is basically like so:
# $ = your local dev machine
# prod$ = production server
$ git clone git://github.com/boaf/posner.git
$ cd posner
$ rm -rf .git* # Kill all pieces of git
$ vagrant up
$ cd www/wp-content/themes/kickass-theme
$ vi index.php # Do work...
# Let's say at this point you're ready to go live
# Recalling that we're in www/wp-content/kickass-theme
$ git init
$ git add remote origin master repo://to/your/kickass-theme
$ git add .
$ git commit -m "lookit dis kickass theme, aw yisssss"
$ git push
prod$ cd /var/www/blog/wp-content/themes
prod$ git clone repo://to/your/kickass-theme
# BAM you're done