Skip to content

Instantly share code, notes, and snippets.

@itsazzad
Created December 16, 2015 16:40
Show Gist options
  • Save itsazzad/839d9e7f6d0347e34cfe to your computer and use it in GitHub Desktop.
Save itsazzad/839d9e7f6d0347e34cfe to your computer and use it in GitHub Desktop.
Vagrantfile used in my Mac which provides dns hostname patterns, variable ip, and all possible changeable folders out of the box
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"#change it?
config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
config.vm.network "forwarded_port", guest: 443, host: 8443, auto_correct: true
# https://github.com/BerlinVagrant/vagrant-dns
config.dns.tld = "dev"
config.vm.hostname = "hostname"#change it
config.dns.patterns = [/^.*hostname.dev$/]#change it
config.vm.network "private_network", ip: "192.168.16.22"#change it
config.vm.network "public_network", bridge: "en1: Wi-Fi (AirPort)"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.synced_folder "./www", "/var/www", type: "nfs"
config.vm.synced_folder "./apache2/etc", "/etc/apache2", type: "nfs"
config.vm.synced_folder "./apache2/log", "/var/log/apache2", type: "nfs"
config.vm.synced_folder "./apache2/php5", "/etc/php5/apache2", type: "nfs"
config.vm.synced_folder "./mysql", "/var/lib/mysql", type: "nfs"
end
# optional
VagrantDNS::Config.logger = Logger.new("dns.log")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment