The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
---
% my $root = dir "@{[ home ]}/var/run";
% $root->mkpath(0,0700);

url: http://<%= $host %>:<%= $port %>
start_mode:
  - hypnotoad
  - apache

apache:
  args: -f <%= $root %>/apache.<%= $port %>.conf -E <%= $root %>/apache.<%= $port %>.startup.log
  pid_file: <%= $root %>/apache.<%= $port %>.pid
  autogen:
    filename: <%= $root %>/apache.<%= $port %>.conf
    content: |
      LoadModule unixd_module      modules/mod_unixd.so
      LoadModule headers_module    modules/mod_headers.so
      LoadModule proxy_module      modules/mod_proxy.so
      LoadModule proxy_http_module modules/mod_proxy_http.so
      LoadModule authn_core_module modules/mod_authn_core.so
      LoadModule authz_core_module modules/mod_authz_core.so
      LoadModule authz_host_module modules/mod_authz_host.so
      LoadModule log_config_module modules/mod_log_config.so
      
      Listen <%= $host %>:<%= $port %>
      ServerName <%= $host %>
      PidFile <%= $root %>/apache.<%= $port %>.pid
      
      ErrorLog   <%= $root %>/apache.<%= $port %>.error.log
      LogFormat "%h %l %u %t \"%r\" %>s %b" common
      CustomLog  <%= $root %>/apache.<%= $port %>.access.log common
      
      <Location />
        ProxyPreserveHost On
        ProxyPass         http://localhost:<%= $port %>/
        ProxyPassReverse  http://localhost:<%= $port %>/
        RequestHeader append set X-Forward-Proto
        <RequireAll>
          Require all granted
        </RequireAll>
      </Location>

hypnotoad:
  listen:
    - http://127.0.0.1:<%= $port %>
  pid_file: <%= $root %>/hypnotoad.<%= $port %>.pid