]> git.openstreetmap.org Git - chef.git/blob - cookbooks/osqa/templates/default/apache.erb
Teach cgiirc about site aliases
[chef.git] / cookbooks / osqa / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 WSGIDaemonProcess <%= @name %> user=<%= @user %> group=<%= @group %> processes=4 threads=4
4
5 <VirtualHost *:80>
6         ServerName <%= @name %>
7         <% @aliases.each do |alias_name| -%>
8                 ServerAlias <%= alias_name %>
9         <% end -%>
10         ServerAdmin webmaster@openstreetmap.org
11
12         CustomLog /var/log/apache2/<%= @name %>-access.log combined
13         ErrorLog /var/log/apache2/<%= @name %>-error.log
14
15         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
16         RedirectPermanent / https://<%= @name %>/
17 </VirtualHost>
18 <% unless @aliases.empty? -%>
19
20 <VirtualHost *:443>
21         ServerName <%= @aliases.first %>
22 <% @aliases.drop(1).each do |alias_name| -%>
23         ServerAlias <%= alias_name %>
24 <% end -%>
25         ServerAdmin webmaster@openstreetmap.org
26
27         SSLEngine on
28         SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
29         SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
30
31         CustomLog /var/log/apache2/<%= @name %>-access.log combined
32         ErrorLog /var/log/apache2/<%= @name %>-error.log
33
34         RedirectPermanent / https://<%= @name %>/
35 </VirtualHost>
36 <% end -%>
37
38 <VirtualHost *:443>
39         ServerName <%= @name %>
40         ServerAdmin webmaster@openstreetmap.org
41
42         SSLEngine on
43         SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
44         SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
45
46         CustomLog /var/log/apache2/<%= @name %>-access.log combined
47         ErrorLog /var/log/apache2/<%= @name %>-error.log
48
49         DocumentRoot <%= @directory %>/osqa
50         Alias /m/ <%= @directory %>/osqa/forum/skins/
51         Alias /upfiles/ <%= @directory %>/upfiles/
52         Alias /admin_media/ /usr/share/pyshared/django/contrib/admin/media/
53         WSGIScriptAlias / <%= @directory %>/osqa/osqa.wsgi
54
55         WSGIProcessGroup <%= @name %>
56 </VirtualHost>
57
58 <Directory <%= @directory %>/osqa>
59         Require all granted
60 </Directory>
61
62 <Directory <%= @directory %>/upfiles>
63         Require all granted
64 </Directory>