Add Vagrantfile
This commit is contained in:
parent
f9c0aacaec
commit
5e222d4351
42
Vagrantfile
vendored
Normal file
42
Vagrantfile
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "scotch/box"
|
||||
config.vm.network "private_network", ip: "192.168.33.10"
|
||||
config.vm.hostname = "scotchbox"
|
||||
config.vm.synced_folder "./", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
# Edit just VagrantDomain:
|
||||
|
||||
# Domain
|
||||
VagrantDomain=( "app1.dev" "app2.dev" )
|
||||
|
||||
# ------------ #
|
||||
|
||||
sudo rm -rf /etc/apache2/sites-available/*.dev.conf
|
||||
sudo rm -rf /etc/apache2/sites-enabled/*.dev.conf
|
||||
|
||||
# Loop through all sites
|
||||
for ((i=0; i < ${#VagrantDomain[@]}; i++)); do
|
||||
|
||||
## Current Domain
|
||||
DOMAIN=${VagrantDomain[$i]}
|
||||
mkdir -p /var/www/$DOMAIN/public
|
||||
|
||||
echo "Creating vhost config for $DOMAIN..."
|
||||
sudo cp /etc/apache2/sites-available/scotchbox.local.conf /etc/apache2/sites-available/$DOMAIN.conf
|
||||
|
||||
sudo sed -i s,scotchbox.local,$DOMAIN,g /etc/apache2/sites-available/$DOMAIN.conf
|
||||
sudo sed -i s,/var/www/public,/var/www/$DOMAIN/public,g /etc/apache2/sites-available/$DOMAIN.conf
|
||||
|
||||
sudo a2ensite $DOMAIN.conf
|
||||
done
|
||||
|
||||
echo "So let's restart apache..."
|
||||
sudo service apache2 restart
|
||||
|
||||
SHELL
|
||||
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user