]> git.openstreetmap.org Git - chef.git/blob - cookbooks/trac/templates/default/apache.erb
3b18fefb19641a6132f2f26e0d37cb0ae1314acd
[chef.git] / cookbooks / trac / 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=8 restart-interval=3600 inactivity-timeout=180 graceful-timeout=60 maximum-requests=2000
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 %>/htdocs
50   Alias /robots.txt <%= @directory %>/htdocs/site/robots.txt
51   WSGIScriptAlias / <%= @directory %>/cgi-bin/trac.wsgi
52
53   WSGIProcessGroup <%= @name %>
54
55   DefineExternalAuth osm pipe /usr/local/bin/trac-authenticate
56
57   # Disable /timeline for now
58   RedirectMatch 410 /timeline ^/timeline(.*)$
59
60   <Location /login>
61     AuthType Basic
62     AuthName "OpenStreetMap Trac"
63     AuthBasicProvider external
64     AuthExternal osm
65     Require valid-user
66   </Location>
67 </VirtualHost>
68
69 <Directory <%= @directory %>/htdocs>
70   Require all granted
71 </Directory>
72
73 <Directory <%= @directory %>/cgi-bin>
74   Require all granted
75 </Directory>