git clone https://github.com/kadimi/wp.box.git && cd wp.box && vagrant up
Then visit http://wp.box/.
- Clone this repository
git clone https://github.com/kadimi/wp.box.git awesome.box
- Change directory
cd awesome.box
- Bring machine up
# # For http://wp.box/
# vagrant up
# For http://awesome.box/, provide a hostname with the first `vagrant up`
hostname='awesome.box' vagrant up
- Visit website
URL is http://wp.box/ unless you provided a hostname, e.g. http://awesome.box/.
A lot of tools are included, but more importantly:
- Adminer at /adminer.php
- Composer
- PHPUnit
- WP-CLI,
wp
from guest or./wp
from host - Xdebug
You can run WP-CLI commands directly from the host machine, no need for vagrant ssh
, here are some examples:
$ ./wp plugin list +---------+----------+--------+---------+ | name | status | update | version | +---------+----------+--------+---------+ | jetpack | inactive | none | 5.1 | | lessphp | active | none | 2.0.1 | +---------+----------+--------+---------+ Connection to 127.0.0.1 closed. $ ./wp plugin search git Success: Showing 10 of 1325 plugins. +------------------------+-----------------------+--------+ | name | slug | rating | +------------------------+-----------------------+--------+ | WordPress GitHub Sync | wp-github-sync | 100 | | Event List | event-list | 92 | | ... | ... | ... | +------------------------+-----------------------+--------+ Connection to 127.0.0.1 closed.
-
WordPress
- Username is
admin
- Password is
password
- Username is
-
Database
- Username is
root
- Password is
root
- Username is
- A random port is chosen on the first boot from
8800
to8899
and is stored in a file namedport
. The port is forwarded to port80
on the guest machine. This comes in handly if you want to show your website over the Internet when you are behind a rooter (you will probably be using No-IP, Dyn or similar).
Something like this running periodically:
#!/usr/bin/env bash
D='/var/www/public/wp-content/backup';
mkdir -p $D;
wp db export $D/"`date +"db-%s-%F-%H-%M-%S.sql"`" --add-drop-table;