Create/Update apache virtualhost on the same node for diff subdomains using Chef server

chef

I've two applications to deploy/run using chef on a single node under the same domain/subdomain. One is a Rails app and another is a WordPress app.

The Rails app will reside as the main app at say example.com and the wordpress at blog.example.com. And lets assume that I'll be using Apache2 as the webserver to handle the VirtualHost.

The examples and posts so far I've searched and found deals with one app per node. But for me the challenge is how to deploy multiple apps on the single node under the same domain using VirtualHost?

I can created 2 separate run_list adding different roles to it.
Later, when I have to add another app on the same domain, e.g. forum.example.com on the same node, I can create a separate run_list for this. But how do I update/ammend the VirtualHost of the Apache server since its only one per node?

Best Answer

The apache2 cookbook published by Opscode can do this.

See the web_app and apache_site definitions, documented usage in the README.md file (displayed by default on the link above).

Related Topic