Sha256: b5425e5236cc8cbb148afa47c8c20c473245905caec6ae3c1cfe48c47dc4fbca

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

<%
  @path = "/etc/apache2/sites-available/#{rubber_env.app_name}-passenger"
  @post = "a2enmod rewrite && a2enmod ssl && a2ensite #{rubber_env.app_name}-passenger"
%>

<% [rubber_env.passenger_listen_port, rubber_env.passenger_listen_ssl_port].each do |port| %>

Listen <%= port %>
<VirtualHost *:<%= port %>>
  ServerName      <%= rubber_env.domain %>
<%- if rubber_env.web_aliases -%>
  ServerAlias	    <%= rubber_env.web_aliases.join(" ") %>
<%- end -%>
  DocumentRoot    <%= Rubber.root + "/public" %>

  ErrorDocument 404 /404.html
  ErrorDocument 500 /500.html

  SetEnvIf User-Agent "^(.*MSIE.*)|(.*AppleWebKit.*)$" nokeepalive

  RailsEnv  <%= Rubber.env %>

  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^<%= rubber_env.domain %>$
  RewriteRule ^(.*)$ http://www.<%= rubber_env.domain %>$1 [R,L]

  # Include <%= Rubber.root %>/config/apache/rewrites.conf

  RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html  
  RewriteRule ^.*$ /system/maintenance.html [L]
  
  <% if port == rubber_env.passenger_listen_ssl_port %>
  SSLEngine on
  SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  # SSLCertificateFile <%= Rubber.root %>/config/<%= rubber_env.domain %>.crt
  # SSLCertificateKeyFile <%= Rubber.root %>/config/<%= rubber_env.domain %>.key
  # SSLCertificateChainFile /etc/ssl/certs/gd_intermediate_bundle.crt
  <% end %>

</VirtualHost>

<% end %>

# The host here needs to match ServerName.
PassengerPreStart http://<%= rubber_env.domain %>:<%= rubber_env.passenger_listen_port %>/

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubber-2.0.0.pre1 templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf