I\'ve built a vagrant/virtualbox web server as a development sandbox, and configured apache in the VM for ssl (on the default port 443, with a self-signed certificate). I\'ve te
The answer above would require you to keep repeating steps 2 and 3 each time you destroy the box. I'd suggest you use Chef to achieve your goal. See the example below:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 443, host: 443
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "/path/to/your/cookbooks"
# Install PHP
chef.add_recipe "php"
chef.add_recipe "php::module_mysql"
# Setup Apache
chef.add_recipe "apache2"
chef.add_recipe "apache2::mod_php5"
chef.json = { :apache => { :default_site_enabled => true } }
end
end