A modern, easy to configure, WordPress ready Vagrant box, perfect for local development.
This project was inspired by Scotch Box and built using the Scotch Box Pro build scripts by Nicholas Cerminara. If you like this project, please also consider supporting Nick by purchasing a Scotch Box Pro license at a mere $15.
Make sure you have the following software installed
This plugin will allow your system to manage writing to the hosts file automatically, instead of having to edit /etc/hosts each time.
The Boss Box image is approximately 900mb in size. This means that the first time you use it, you'll have to download it to your hard drive, meaning your first vagrant up could take a little while.
From a terminal window:
Clone the github repo
git clone git@github.com:jonathanbossenger/boss-box-lamp.git
Switch to the boss-box-lamp directory
cd boss-box-lamp
Copy the 'vagrant' folder to your project web root
cp -r vagrant/ /path/to/myproject/webroot/vagrant/
Switch to the project vagrant directory
cd ~/path/to/myproject/webroot/vagrant/
Edit the settings.yaml file in the newly copied /path/to/myproject/webroot/vagrant/ directory as required.
Start BossBox
vagrant up
vagrant up
Start the virtual machine
vagrant halt
Stop the virtual machine
vagrant ssh
Login to the virtual machine via SSH
Login to the virtual machine via SSH
vagrant ssh
Switch to the /var/www/public directory
cd /var/www/public
Download WordPress via the CLI
wp core download
Create the wp-config.php file, replace {database_name} and {password} with the values you set for those fields in your settings.yaml.
wp config create --dbname={database_name} --dbuser=root --dbpass={password}
Run the famous 5 second WP-CLI install, replace {sitename} with the value you set for that field in your settings.yaml and change the rest to suit your needs.
wp core install --url={sitename} --title=Example --admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com
Browse to your Vagrant IP address or sitename and see your WP instal.
You can access the local site by either the IP address or sitename specified in your settings.yaml (if you have set the relevant /etc/hosts record)
http://192.168.33.10 or http://sitename
PHPMyAdmin
http://192.168.33.10/phpmyadmin or http://sitename/phpmyadmin
MailHog
http://192.168.33.10:8025 or http://sitename:8025
This box has Xdebug installed and is setup to make use of the Zero-configuration Debugging with PhpStorm
On the first run, PHPStorm will ask you to map the debugger to a local path, you should be able to accept the defaults.
Boss box has it's own custom PHP.ini file for overriding the default PHP.ini. You can find this file in the following location.
/etc/php/7.0/apache2/conf.d/user.ini
Enjoy!