Markus Joschko
Markus Joschko

Reputation: 196

Setup apache2 with a custom docroot in vagrant using chef

I am a complete newbie to vagrant and chef. As a first project I decided to simply setup an apache2 and point the docroot to the shared folder.

That seems to require the execution of the "web_app" goal of the apache2 recipe of chef and giving the docroot as a variable. However I am not able to figure out how to do this in the context of vagrant.

Upvotes: 1

Views: 483

Answers (1)

Andriy Samilyak
Andriy Samilyak

Reputation: 413

First, be sure that you use the latest version of Apache cookbook

Second, when writing new cookbook, declare dependency on apache2 cookbook in metadata.rb

depends "apache2"

Third, use in your cookbook something like this:

include_recipe "apache2"

web_app "testrail" do
    server_name "myproject.com"
    server_aliases ["myproject.com"]
    docroot "/var/www/customroot"
    cookbook "apache2"
end

Upvotes: 1

Related Questions