Answer the question
In order to leave comments, you need to log in
How to set up vagrant + virtualbox on windows 10 for many sites (as it is done on hosting)?
I'm trying to set up vagrant to make development easier.
The idea is to do about the same as on hosting.
Create 1 project in PhpStorm (eg dev_server), configure the server itself. Store all sites in the public_html folder. Install everything you need globally (gulp, npm, different clis, etc.) so you don't have to download the same packages for every project. In PhpStorm, create a separate project for each site (to work with a specific project, deployment settings, etc.)
I tried to do it with ubuntu/trusty64, but something did not work. I can't figure out how to access the site from a browser.
Did something like this:
vagrant init ubuntu/trusty64
vagrant up
<VirtualHost *:80>
DocumentRoot "/var/www/public_html/site1.loc"
ServerName site1.loc
<Directory "/var/www/public_html/site1.loc">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/public_html/site2.loc"
ServerName site2.loc
<Directory "/var/www/public_html/site2.loc">
AllowOverride All
</Directory>
</VirtualHost>
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "test.dev.loc"
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
config.ssh.insert_key = false
# Optional NFS. Make sure to remove other synced_folder line too
config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=777",'actimeo=1'] }
# config.vm.provision :shell, path: "shell.sh"
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question