Example Vagrant setup that uses SaltStack to provision a LAMP box for dev purposes.
It's a platform-independent, version-controlled, repeatable, reproducible, shareable, customizeable, authentic replacement for all the *AMP packages out there (if you are still wondering why, you are probably stupid and ugly).
- VirtualBox
- Vagrant
- Salty Vagrant (
vagrant plugin install vagrant-salt
)
With just a few commands you'll have a virtual machine up and running ...
git clone https://github.com/jehoshua02/salty-vagrant-lamp-dev.git
cd salty-vagrant-lamp-dev
vagrant up
The first run of vagrant up
will take some time: the base box must be downloaded, a new vagrant box must be created
from the base box, salt must be installed in the vagrant box, and salt will then install and configure the LAMP stack.
The next time vagrant up
is executed none of these things will need to be performed again.
If everything ran smoothly, you should be able to open http://192.168.200.10
and see something other than an error
page. Ideally, the host name, full path of index file executed, and a list of hosts (which you can add to your hosts
file if you want).
You should also be able to connect as root
, password root
, to 192.168.200.10
with your favorite MySql tool (MySql Workbench, Sequel Pro, or just the plain-old cli client)
Adding hosts to the setup is simple, and it doesn't involve modifying any VirtualHost
definitions or restarting
Apache. It's only two step. For example, if the host being added were dev.myhost.com
:
- Add a directory named
dev.myhost.com
indocroots
. - Add
192.168.200.10 dev.myhost.com
to your hosts file.