我已经设置了我的第一台流浪机器,并通过刀下载了一些食谱。
我被虚拟主机的设置困住了。
这是我的流浪文件:
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.provision :chef_solo do |chef|
chef.json = {
"mysql" => {
"server_root_password" => "admin",
"server_repl_password" => "admin",
"server_debian_password" => "admin"
},
"apache" => {
"listen_address" => "0.0.0.0"
}
}
chef.add_recipe "apt"
chef.add_recipe "vim"
chef.add_recipe "openssl"
chef.add_recipe "apache2"
chef.add_recipe "mysql"
chef.add_recipe "mysql::server"
chef.add_recipe "php"
# chef.add_recipe "php::module_apc"
chef.add_recipe "php::module_curl"
chef.add_recipe "php::module_mysql"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_rewrite"
end
web_app "blog_site" do
server_name "blog"
server_aliases [ "blog.#{node['domain']}", node['fqdn'] ]
docroot "/var/www/blog_site"
end
#
end
我在这里看到,如果我想通过 apache 食谱设置虚拟主机,我必须使用“web_app”定义。
我已将其添加web_app
到 vagrant 文件中,但出现此错误
in `block in <top (required)>': undefined method `web_app' for main:Object (NoMethodError)
这意味着(我认为)语法错误:)
我怎样才能解决这个问题?“web_app”的定义在哪里?