Segue meu Vagrantfile
:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch"
config.vm.network "private_network", ip: "192.168.33.107"
config.vm.hostname = "scotchbox"
config.vm.synced_folder "../public/", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
# Optional NFS. Make sure to remove other synced_folder line too
#config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
end
Estou fazendo para atender a seguinte estrutura de diretórios:
-| D
---| Projetos
-----| PHP
-------| 5
-------| 7
-------| public
Onde no diretório PHP, tenho diferentes máquinas com versões do php distintas, e na mesma pasta tenho o public
, onde irei colocar meus projetos, a ideia é compartilhar esse diretório como se fosse o meu /var/www
de todas as máquinas, na teoria meu Vagrantfile
está funcionando, a máquina liga normalmente, mas ao acessar o IP dela pelo navegador é dado o 404 Not Found
, o que pode ser?
A saída do meu vagrant up
é:
PS D:\Projetos\PHP\7> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.10 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /var/www => D:/Projetos/PHP/public
default: /vagrant => D:/Projetos/PHP/7
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
Obs: já determinei permissões para o grupo "Todos" do Windows.