I've setup my first vagrant machine, with some cookbooks downloaded through knife.
I am stuck with the setup of a virtual host.
Here's my Vagrantfile:
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
I've seen here that if I want to set a virtual host through the apache cookbook I have to use the "web_app" definition.
I've added the web_app
to the vagrant file but I am getting this error
in `block in <top (required)>': undefined method `web_app' for main:Object (NoMethodError)
that means (I think) that syntax is wrong :)
How can I fix this? Where the definition "web_app" goes?