<VirtualHost *:80>
  ServerName <%= @params[:server_name] %>
  <% if @params[:server_aliases] && !@params[:server_aliases].empty? -%>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
  <% end -%>
  DocumentRoot <%= @params[:docroot] %>
  RewriteEngine On

  <Directory <%= @params[:docroot] %>>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  <Location /server-status>
    SetHandler server-status

    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
  </Location>

  LogLevel <%= node[:apache][:log_level] %>
  ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
  CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined

  FileETag none

  RewriteEngine On

  # Canonical host, <%= @params[:server_name] %>
  RewriteCond %{HTTP_HOST}   !^<%= @params[:server_name] %> [NC]
  RewriteCond %{HTTP_HOST}   !^$
  RewriteRule ^/(.*)$        http://<%= @params[:server_name] %>/$1 [L,R=301]

  RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /system/maintenance.html [L]

  <% if node[:deploy][application_name].present? and node[:deploy][application_name][:aliases] %>
      <% node[:deploy][application_name][:aliases].each do |alias| %>
          Alias <%= alias[:url_path] %> <%= @params[:docroot] %><%= alias[:file_path] %>
      <% end %>
  <% end %>

</VirtualHost>

Add possibility to setup app apache aliases
Add possibility to setup app apache aliases
