<VirtualHost *:<%= @params[:port] %>>
  ServerName <%= @params[:server_name] %>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= a %> <% end %>
  DocumentRoot <%= @params[:docroot] %>

  <Directory <%= @params[:docroot] %>>
    Options <%= [@params[:directory_options] || "Indexes FollowSymLinks" ].flatten.join " " %>
    AllowOverride <%= [@params[:allow_override] || "None" ].flatten.join " " %>
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>

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

<VirtualHost *:<%= @params[:port] %>>
  ServerName <%= @params[:server_name] %>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= a %> <% end %>
  DocumentRoot <%= @params[:docroot] %>

  <Directory <%= @params[:docroot] %>>
    Options <%= [@params[:directory_options] || "Indexes FollowSymLinks" ].flatten.join " " %>
    <% if node['apache']['version'] == '2.4' -%>
      Require all granted
    <% else -%>
      AllowOverride <%= [@params[:allow_override] || "None" ].flatten.join " " %>
      Order allow,deny
      Allow from all
    <% end -%>
  </Directory>

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

Make sure we maintain compatiablity with apache 2.4
Make sure we maintain compatiablity with apache 2.4
