# File Managed by Puppet

<VirtualHost *:<%= port %>>
    ServerAdmin <%= server_admin_email %>
    DocumentRoot <%= real_docroot %>
<% if server_name_value != false -%>
    ServerName <%= server_name_value %>
<% end -%>
<% if serveraliases != "" -%>
<% if serveraliases.is_a? Array -%>
    ServerAlias <% serveraliases.each do |name| -%> <%= name %><% end %>
<% else -%>
    ServerAlias <%= serveraliases %>
<% end -%>
<% end -%>
<% if environment != "" -%>
    SetEnv ENVIRONMENT <%= scope.lookupvar('::environment') %>
<% end -%>
    ErrorLog  <%= scope.lookupvar('apache::log_dir') %>/<%= name %>-error.log
    CustomLog <%= scope.lookupvar('apache::log_dir') %>/<%= name %>-access.log common
    
    <Directory <%= real_docroot %> >
        AllowOverride All
    </Directory>
</VirtualHost>
