<% @params[:listen_ports].each do |port| -%>
<VirtualHost <%= @params[:listen_addresses] %>:<%= port %>>
  ServerName <%= @params[:server_name] %>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
  DocumentRoot <%= @params[:docroot] %>
  RewriteEngine On

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

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  <Location /server-status>
    SetHandler server-status
    Order Allow,Deny
    Allow from all
  </Location>

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

  RewriteEngine On
  RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
  # level 0 => Do not log rewrite
  RewriteLogLevel 0
  <% if port === "443" -%>

  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  <% end -%>
</VirtualHost>

<% end -%>

<% @params[:listen_ports].each do |port| -%>
<VirtualHost <%= @params[:listen_addresses] %>:<%= port %>>
  ServerName <%= @params[:server_name] %>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
  DocumentRoot <%= @params[:docroot] %>
  RewriteEngine On

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

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  <Location /server-status>
    SetHandler server-status
    Order Allow,Deny
    Allow from all
  </Location>

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

  RewriteEngine On
  RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
  # level 0 => Do not log rewrite
  RewriteLogLevel 3
  <% if port === "443" -%>

  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  <% end -%>
</VirtualHost>

<% end -%>

Increase debug info on Apache's logs
Increase debug info on Apache's logs
