/
ssl.template.erb
183 lines (152 loc) · 6.02 KB
/
ssl.template.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
####
##
#
# This file is automatically generated from the template located at
# /etc/symbiosis/apache.d/ssl.template.erb.
#
# Feel free to make changes to this file, and thereafter it will not be
# automatically updated if the template, or SSL configuration changes.
#
# For SSL documenation please consult:
#
# http://symbiosis.bytemark.co.uk/jessie/docs/ch-ssl-hosting.html
#
##
###
<VirtualHost <%= ips.collect{|ip| ip+":443"}.join(" ") %>>
#
# Put our server name
#
ServerName <%= domain %>
#
# This is the testing alias.
#
ServerAlias <%= domain %>.testing.<%= hostname() %>
#
# And server alias in place
#
<%= server_aliases %>
<IfModule ssl_module>
SSLEngine On
#
# The certificate, key, and intermediate bundle (if needed)
#
<%= ssl_config %>
#
# Intermediate configuration, taken from
# https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=apache-2.4.10&openssl=1.0.1k&hsts=yes&profile=intermediate
#
SSLProtocol all -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
SSLCompression off
#
# OCSP Stapling -- make sure you remove the reject-www-data
# rule from the outgoing firewall if you use this.
#
SSLUseStapling off
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
% if mandatory_ssl?
<IfModule headers_module>
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always set Strict-Transport-Security "max-age=15768000"
</IfModule>
% end
</IfModule>
#
# Allow users to override settings via .htaccess
#
<Directory <%=domain_directory%> >
AllowOverride all
Require all granted
</Directory>
#
# The document root
#
DocumentRoot <%= htdocs_directory %>/
<IfModule cgi_module>
#
# General CGI Handling
#
ScriptAlias /cgi-bin/ <%= cgibin_directory %>/
<Location /cgi-bin>
Options +ExecCGI
</Location>
</IfModule>
#
# Disable indexes by default on the top-level.
#
<LocationMatch "^/+$">
Options -Indexes
</LocationMatch>
#
# We need to log the virtual hostname the incoming request was
# made against, so that the cron-job in /etc/cron.daily may generate
# statistics for each domain.
#
ErrorLog "|| /usr/sbin/symbiosis-httpd-logger -s -u <%= domain.uid %> -g <%= domain.gid %> <%= domain.log_dir %>/ssl_error.log"
CustomLog "|| /usr/sbin/symbiosis-httpd-logger -s -u <%= domain.uid %> -g <%= domain.gid %> <%= domain.log_dir %>/ssl_access.log" combined
</VirtualHost>
<VirtualHost <%= ips.collect{|ip| ip+":80"}.join(" ") %>>
#
# Put our server name
#
ServerName <%= domain %>
#
# This is the testing alias.
#
ServerAlias <%= domain %>.testing.<%= hostname() %>
#
# And server alias in place
#
<%= server_aliases %>
% if mandatory_ssl?
<IfModule rewrite_module>
#
# This redirects all accesses to the HTTPS version of the site.
#
RewriteEngine On
#
# Use our server nane if HTTP_HOST is empty.
#
RewriteCond "%{HTTP_HOST}" =""
RewriteRule ^/?(.*) https://<%= domain %>/$1 [R=301,L]
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
% else
#
# Allow users to override settings via .htaccess
#
<Directory <%=domain_directory%> >
AllowOverride all
Require all granted
</Directory>
#
# The document root
#
DocumentRoot <%= htdocs_directory %>/
<IfModule cgi_module>
#
# General CGI Handling
#
ScriptAlias /cgi-bin/ <%= cgibin_directory %>/
<Location /cgi-bin>
Options +ExecCGI
</Location>
</IfModule>
#
# Disable indexes by default
#
<LocationMatch "^/+$">
Options -Indexes
</LocationMatch>
#
# We need to log the virtual hostname the incoming request was
# made against, so that the cron-job in /etc/cron.daily may generate
# statistics for each domain.
#
ErrorLog "|| /usr/sbin/symbiosis-httpd-logger -s -u <%= domain.uid %> -g <%= domain.gid %> <%= domain.log_dir %>/error.log"
CustomLog "|| /usr/sbin/symbiosis-httpd-logger -s -u <%= domain.uid %> -g <%= domain.gid %> <%= domain.log_dir %>/access.log" combined
% end
</VirtualHost>