# ************************************ # Askbot vhost template # Managed by Puppet # ************************************ <% trusty_compatible = @lsbdistcodename == 'trusty' %> WSGIRestrictStdout On WSGIRestrictSignal Off NameVirtualHost <%= @vhost_name %>:80 :80> <% if scope.lookupvar('::askbot::config::site_ssl_enabled') %> ServerName <%= @srvname %> Redirect / https://<%= @srvname %>/ NameVirtualHost <%= @vhost_name %>:443 :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/ /static/> Order deny,allow Allow from all <%if trusty_compatible %>Require all granted<%end%> # uploaded files Alias /upfiles/ <%= @docroot %>/upfiles/ /upfiles/> Order deny,allow Allow from all <%if trusty_compatible %>Require all granted<%end%> # 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 WSGIProcessGroup askbot Order deny,allow Allow from all <%if trusty_compatible %>Require all granted<%end%> ErrorLog /var/log/apache2/<%= @name %>_error.log LogLevel warn CustomLog /var/log/apache2/<%= @name %>_access.log combined ServerSignature Off