2016-07-15 100 views
0

我剛開始學習如何在我的開發環境中使用vagrant,並且遇到了麻煩。Vagrant將'webroot'文件夾添加到我的開發環境

當我在項目的根目錄vagrant up,它添加了一個webroot文件夾,這不是我所追求的。

流浪漢給我下面的結構,與隨機根目錄文件夾,我覺得這是財產以後做sym_links,但沒有谷歌搜索量給我一個答案

| ProjectName ~ Main Project Folder 
-| .vagrant ~ Vagrant folder 
-| puppet ~ Puppet Configuration Folder 
-| vendor ~ Composer vendor folder 
-| webroot ~ Randomly added folder :/ 
- .gitignore 
- composer.json 
- composer.lock 
- Vagrantfile 

我Vagrantfile

Vagrant.configure("2") do |config| 

    config.vm.define "aws-control" do |namechase| 
    end 

    # Enable the Puppet provisioner, with will look in manifests 
    config.vm.provision :puppet do |puppet| 
    puppet.manifests_path = "puppet/manifests" 
    puppet.manifest_file = "default.pp" 
    puppet.module_path = "puppet/modules" 
    end 

    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "ubuntu/trusty64" 

    # Forward guest port 80 to host port 80 and name mapping 
    config.vm.network :forwarded_port, guest: 80, host: 80 

    config.vm.network "public_network", 
        ip: "192.168.0.61", 
        bridge: "en0: Ethernet" 

    config.vm.hostname = "control.aws" 

    # Synced Folders 
    config.vm.synced_folder "/", "/vagrant/webroot/", :owner => "www-data" 
end 

回答

1

分配config.vm.synced_folder時你正在做什麼,你是在/vagrant/webroot目錄下掛載整個主機文件系統。你確定這就是你打算做的?嘗試掛載任何其他目錄,您將看到webroot目錄未被創建。

例如,這將共享vagrant項目目錄,它工作正常。

config.vm.synced_folder ".", "/vagrant/webroot/", :owner => "www-data" 
+0

謝謝,我以某種方式在鏈接到項目根的印象下,而不是主機根:) –

相關問題