puppet-askbot/templates/askbot.vhost.erb

64 lines
2.1 KiB
Plaintext

# ************************************
# Askbot vhost template
# Managed by Puppet
# ************************************
<% trusty_compatible = @lsbdistcodename == 'trusty' %>
WSGIRestrictStdout On
WSGIRestrictSignal Off
NameVirtualHost <%= @vhost_name %>:80
<VirtualHost <%= @vhost_name %>:80>
<% if scope.lookupvar('::askbot::config::site_ssl_enabled') %>
ServerName <%= @srvname %>
Redirect / https://<%= @srvname %>/
</VirtualHost>
NameVirtualHost <%= @vhost_name %>:443
<VirtualHost <%= @vhost_name %>:443>
SSLEngine on
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile <%= scope.lookupvar('::askbot::config::site_ssl_cert_file') %>
SSLCertificateKeyFile <%= scope.lookupvar('::askbot::config::site_ssl_key_file') %>
<% if ![nil, :undef].include?(scope.lookupvar('::askbot::config::site_ssl_chain_file_contents')) %>
SSLCertificateChainFile <%= scope.lookupvar('::askbot::config::site_ssl_chain_file') %>
<% end %>
<% end %>
ServerName <%= @srvname %>
# DocumentRoot <%= @docroot %>
# media files
Alias /m/ <%= @docroot %>/static/
<Directory <%= @docroot %>/static/>
Order deny,allow
Allow from all
<%if trusty_compatible %>Require all granted<%end%>
</Directory>
# uploaded files
Alias /upfiles/ <%= @docroot %>/upfiles/
<Directory <%= @docroot %>/upfiles/>
Order deny,allow
Allow from all
<%if trusty_compatible %>Require all granted<%end%>
</Directory>
# wsgi daemon
WSGIDaemonProcess askbot user=<%= scope.lookupvar('::askbot::www_user') %> group=<%= scope.lookupvar('::askbot::www_group') %> maximum-requests=1000 display-name=askbot processes=2 threads=1 shutdown-timeout=10 python-path=<%= @docroot %>:/usr/askbot-env/lib/python2.7/site-packages
WSGIScriptAlias / <%= @docroot %>/config/django.wsgi
<Location />
WSGIProcessGroup askbot
Order deny,allow
Allow from all
<%if trusty_compatible %>Require all granted<%end%>
</Location>
ErrorLog /var/log/apache2/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @name %>_access.log combined
ServerSignature Off
</VirtualHost>