Till Brehm
2016-06-15 3ad8446706afa6754de74577bd5334c235192d7c
commit | author | age
216ea1 1 <tmpl_hook name='apache2_vhost:header'>
47cca9 2
T 3 <Directory {tmpl_var name='web_basedir'}/{tmpl_var name='domain'}>
0305b2 4         AllowOverride None
1da57c 5         <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
61bf63 6         Require all denied
1da57c 7         <tmpl_else>
0305b2 8         Order Deny,Allow
M 9         Deny from all
1da57c 10         </tmpl_if>
47cca9 11 </Directory>
T 12
216ea1 13 <tmpl_loop name='vhosts'>
a7bdf8 14 <VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name='port'}>
216ea1 15 <tmpl_hook name='apache2_vhost:vhost_header'>
47cca9 16 <tmpl_if name='php' op='==' value='suphp'>
0305b2 17         DocumentRoot <tmpl_var name='web_document_root'>
47cca9 18 </tmpl_else>
0305b2 19     <tmpl_if name='php' op='==' value='cgi'>
M 20         DocumentRoot <tmpl_var name='web_document_root'>
21     </tmpl_else>
cc6568 22         <tmpl_if name='php' op='==' value='php-fpm'>
H 23         DocumentRoot <tmpl_var name='web_document_root'>
24         </tmpl_else>
c59632 25             <tmpl_if name='php' op='==' value='hhvm'>
MC 26             DocumentRoot <tmpl_var name='web_document_root'>
27             </tmpl_else>
28             DocumentRoot <tmpl_var name='web_document_root_www'>
29             </tmpl_if>
cc6568 30         </tmpl_if>
0305b2 31     </tmpl_if>
47cca9 32 </tmpl_if>
T 33
0305b2 34         ServerName <tmpl_var name='domain'>
47cca9 35 <tmpl_if name='alias'>
0305b2 36         <tmpl_var name='alias'>
47cca9 37 </tmpl_if>
0305b2 38         ServerAdmin webmaster@<tmpl_var name='domain'>
47cca9 39
0305b2 40         ErrorLog /var/log/ispconfig/httpd/<tmpl_var name='domain'>/error.log
3e0034 41
47cca9 42 <tmpl_if name='errordocs'>
0305b2 43         Alias /error/ "<tmpl_var name='web_document_root_www'>/error/"
M 44         ErrorDocument 400 /error/400.html
45         ErrorDocument 401 /error/401.html
46         ErrorDocument 403 /error/403.html
47         ErrorDocument 404 /error/404.html
48         ErrorDocument 405 /error/405.html
49         ErrorDocument 500 /error/500.html
50         ErrorDocument 502 /error/502.html
51         ErrorDocument 503 /error/503.html
47cca9 52 </tmpl_if>
a7bdf8 53
0305b2 54         <IfModule mod_ssl.c>
a7bdf8 55 <tmpl_if name='ssl_enabled'>
53124e 56         SSLEngine on
TB 57         SSLProtocol All -SSLv2 -SSLv3
f89879 58         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: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
MC 59         SSLHonorCipherOrder     on
0c381c 60         # <IfModule mod_headers.c>
TB 61         # Header always add Strict-Transport-Security "max-age=15768000"
62         # </IfModule>
0305b2 63         SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.crt
M 64         SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.key
a7bdf8 65 <tmpl_if name='has_bundle_cert'>
f78f1e 66         <tmpl_if name='apache_version' op='<' value='2.4.8' format='version'>
MC 67         SSLCertificateChainFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
68         </tmpl_if>
f89879 69         <tmpl_if name='apache_version' op='>=' value='2.4' format='version'>
MC 70         SSLUseStapling on
71         SSLStaplingResponderTimeout 5
72         SSLStaplingReturnResponderErrors off
73         </tmpl_if>
a7bdf8 74 </tmpl_if>
dec0df 75 </tmpl_if>
0305b2 76         </IfModule>
dec0df 77
0305b2 78         <Directory {tmpl_var name='web_document_root_www'}>
596a60 79                 # Clear PHP settings of this website
MC 80                 <FilesMatch ".+\.ph(p[345]?|t|tml)$">
81                         SetHandler None
82                 </FilesMatch>
5545f1 83                 Options +FollowSymLinks
0305b2 84                 AllowOverride <tmpl_var name='allow_override'>
1da57c 85                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 86                 Require all granted
1da57c 87                 <tmpl_else>
0305b2 88                 Order allow,deny
M 89                 Allow from all
1da57c 90                 </tmpl_if>
47cca9 91 <tmpl_if name='ssi' op='==' value='y'>
0305b2 92
M 93                 # ssi enabled
94                 AddType text/html .shtml
95                 AddOutputFilter INCLUDES .shtml
96                 Options +Includes
47cca9 97 </tmpl_if>
T 98 <tmpl_if name='php' op='==' value='no'>
0305b2 99                 <Files ~ '.php[s3-6]{0,1}$'>
1da57c 100                         <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 101                         Require all denied
1da57c 102                         <tmpl_else>
0305b2 103                         Order allow,deny
M 104                         Deny from all
105                         Allow from none
1da57c 106                         </tmpl_if>
0305b2 107                 </Files>
47cca9 108 </tmpl_if>
0305b2 109         </Directory>
M 110         <Directory {tmpl_var name='web_document_root'}>
596a60 111                 # Clear PHP settings of this website
MC 112                 <FilesMatch ".+\.ph(p[345]?|t|tml)$">
113                         SetHandler None
114                 </FilesMatch>
5545f1 115                 Options +FollowSymLinks
0305b2 116                 AllowOverride <tmpl_var name='allow_override'>
1da57c 117                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 118                 Require all granted
1da57c 119                 <tmpl_else>
0305b2 120                 Order allow,deny
M 121                 Allow from all
1da57c 122                 </tmpl_if>
47cca9 123 <tmpl_if name='ssi' op='==' value='y'>
0305b2 124
M 125                 # ssi enabled
126                 AddType text/html .shtml
127                 AddOutputFilter INCLUDES .shtml
128                 Options +Includes
47cca9 129 </tmpl_if>
07d3a1 130 <tmpl_if name='php' op='==' value='no'>
0305b2 131                 <Files ~ '.php[s3-6]{0,1}$'>
1da57c 132                     <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 133                     Require all denied
1da57c 134                     <tmpl_else>
8133de 135                     Order allow,deny
MC 136                     Deny from all
137                     Allow from none
1da57c 138                     </tmpl_if>
0305b2 139                 </Files>
07d3a1 140 </tmpl_if>
0305b2 141         </Directory>
07d3a1 142
22ef48 143 <tmpl_if name='ruby' op='==' value='y'>
0305b2 144         <IfModule mod_ruby.c>
M 145             <Directory {tmpl_var name='web_document_root_www'}>
146                 Options +ExecCGI
147             </Directory>
148             RubyRequire apache/ruby-run
149             #RubySafeLevel 0
150             AddType text/html .rb
151             AddType text/html .rbx
152             <Files *.rb>
153                 SetHandler ruby-object
154                 RubyHandler Apache::RubyRun.instance
155             </Files>
156             <Files *.rbx>
157                 SetHandler ruby-object
158                 RubyHandler Apache::RubyRun.instance
159             </Files>
160         </IfModule>
22ef48 161 </tmpl_if>
47cca9 162
ab7597 163 <tmpl_if name='perl' op='==' value='y'>
M 164         <IfModule mod_perl.c>
165             PerlModule ModPerl::Registry
166             PerlModule Apache2::Reload
167             <Directory {tmpl_var name='web_document_root_www'}>
168                 PerlResponseHandler ModPerl::Registry
169                 PerlOptions +ParseHeaders
170                 Options +ExecCGI
171             </Directory>
72d6a8 172             <Directory {tmpl_var name='web_document_root'}>
TB 173                 PerlResponseHandler ModPerl::Registry
174                 PerlOptions +ParseHeaders
175                 Options +ExecCGI
176             </Directory>
6fb93d 177             <Files *.pl>
M 178                 SetHandler perl-script
179             </Files>
ab7597 180         </IfModule>
M 181 </tmpl_if>
182
298ef5 183 <tmpl_if name='python' op='==' value='y'>
0305b2 184         <IfModule mod_python.c>
M 185             <Directory {tmpl_var name='web_document_root_www'}>
3bc1e1 186                 <FilesMatch "\.py$">
MC 187                     SetHandler mod_python
188                 </FilesMatch>
0305b2 189                 PythonHandler mod_python.publisher
M 190                 PythonDebug On
191             </Directory>
192         </IfModule>
298ef5 193 </tmpl_if>
F 194
47cca9 195 <tmpl_if name='cgi' op='==' value='y'>
0305b2 196         # cgi enabled
47cca9 197     <Directory {tmpl_var name='document_root'}/cgi-bin>
1da57c 198             <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 199             Require all granted
1da57c 200             <tmpl_else>
0305b2 201             Order allow,deny
M 202             Allow from all
1da57c 203             </tmpl_if>
0305b2 204         </Directory>
M 205         ScriptAlias  /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
3bc1e1 206         <FilesMatch "\.(cgi|pl)$">
MC 207             SetHandler cgi-script
208         </FilesMatch>
47cca9 209 </tmpl_if>
T 210 <tmpl_if name='suexec' op='==' value='y'>
0305b2 211         # suexec enabled
M 212         <IfModule mod_suexec.c>
213             SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
214         </IfModule>
47cca9 215 </tmpl_if>
T 216 <tmpl_if name='php' op='==' value='mod'>
0305b2 217         # mod_php enabled
M 218         AddType application/x-httpd-php .php .php3 .php4 .php5
61bd1f 219         SetEnv TMP <tmpl_var name='document_root'>/tmp
FT 220         SetEnv TMPDIR <tmpl_var name='document_root'>/tmp
221         SetEnv TEMP <tmpl_var name='document_root'>/tmp
0305b2 222         php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
M 223         php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
224         php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
10f838 225     # PHPIniDir <tmpl_var name='custom_php_ini_dir'>
215d18 226 <tmpl_if name='security_level' op='==' value='20'>
0305b2 227         php_admin_value open_basedir <tmpl_var name='php_open_basedir'>
215d18 228 </tmpl_if>
47cca9 229 </tmpl_if>
T 230 <tmpl_if name='php' op='==' value='suphp'>
0305b2 231         # suphp enabled
M 232         <Directory {tmpl_var name='web_document_root'}>
f8d8a4 233         <IfModule mod_suphp.c>
3bc1e1 234             suPHP_Engine on
MC 235             # suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
7fddfe 236 <tmpl_if name='has_custom_php_ini'>
T 237     suPHP_ConfigPath <tmpl_var name='custom_php_ini_dir'>
238 </tmpl_if>
3bc1e1 239             <FilesMatch "\.php[345]?$">
MC 240                 SetHandler x-httpd-suphp
241             </FilesMatch>
242             suPHP_AddHandler x-httpd-suphp
f8d8a4 243         </IfModule>
0305b2 244         </Directory>
47cca9 245 </tmpl_if>
T 246 <tmpl_if name='php' op='==' value='cgi'>
0305b2 247         # php as cgi enabled
M 248         ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
249         Action php5-cgi /php5-cgi
51910d 250         <Directory {tmpl_var name='web_document_root_www'}>
TB 251             <FilesMatch "\.php[345]?$">
252                 SetHandler php5-cgi
253             </FilesMatch>
254         </Directory>
255         <Directory {tmpl_var name='web_document_root'}>
256             <FilesMatch "\.php[345]?$">
257                 SetHandler php5-cgi
258             </FilesMatch>
259         </Directory>
0305b2 260         <Directory {tmpl_var name='cgi_starter_path'}>
1da57c 261             <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 262             Require all granted
1da57c 263             <tmpl_else>
8133de 264             Order allow,deny
MC 265             Allow from all
1da57c 266             </tmpl_if>
0305b2 267         </Directory>
47cca9 268 </tmpl_if>
T 269 <tmpl_if name='php' op='==' value='fast-cgi'>
0305b2 270         # php as fast-cgi enabled
8fe84f 271     # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
0305b2 272         <IfModule mod_fcgid.c>
92e0ce 273 <tmpl_if name='fastcgi_config_syntax' op='==' value='2'>
0305b2 274                 FcgidIdleTimeout 300
M 275                 FcgidProcessLifeTime 3600
276                 # FcgidMaxProcesses 1000
bfcdef 277                 FcgidMaxRequestsPerProcess <tmpl_var name='fastcgi_max_requests'>
0305b2 278                 FcgidMinProcessesPerClass 0
310f4c 279                 FcgidMaxProcessesPerClass 10
0305b2 280                 FcgidConnectTimeout 3
2ed8f0 281                 FcgidIOTimeout 600
MC 282                 FcgidBusyTimeout 3600
bfcdef 283                 FcgidMaxRequestLen 1073741824
92e0ce 284 <tmpl_else>
0305b2 285                 IdleTimeout 300
M 286                 ProcessLifeTime 3600
287                 # MaxProcessCount 1000
288                 DefaultMinClassProcessCount 0
4fa79c 289                 DefaultMaxClassProcessCount 10
0305b2 290                 IPCConnectTimeout 3
2ed8f0 291                 IPCCommTimeout 600
MC 292                 BusyTimeout 3600
92e0ce 293 </tmpl_if>
0305b2 294         </IfModule>
M 295         <Directory {tmpl_var name='web_document_root_www'}>
3bc1e1 296                 <FilesMatch "\.php[345]?$">
MC 297                     SetHandler fcgid-script
298                 </FilesMatch>
0305b2 299                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
c0a1a4 300                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php3
TB 301                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php4
302                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php5
0305b2 303                 Options +ExecCGI
M 304                 AllowOverride <tmpl_var name='allow_override'>
1da57c 305                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 306                 Require all granted
1da57c 307                 <tmpl_else>
0305b2 308                 Order allow,deny
M 309                 Allow from all
1da57c 310                 </tmpl_if>
0305b2 311         </Directory>
M 312         <Directory {tmpl_var name='web_document_root'}>
3bc1e1 313                 <FilesMatch "\.php[345]?$">
MC 314                     SetHandler fcgid-script
315                 </FilesMatch>
0305b2 316                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
c0a1a4 317                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php3
TB 318                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php4
319                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php5
0305b2 320                 Options +ExecCGI
M 321                 AllowOverride <tmpl_var name='allow_override'>
1da57c 322                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 323                 Require all granted
1da57c 324                 <tmpl_else>
0305b2 325                 Order allow,deny
M 326                 Allow from all
1da57c 327                 </tmpl_if>
0305b2 328         </Directory>
47cca9 329 </tmpl_if>
274362 330 <tmpl_if name='php' op='==' value='php-fpm'>
0305b2 331         <IfModule mod_fastcgi.c>
10b4c8 332                 <Directory {tmpl_var name='document_root'}/cgi-bin>
1da57c 333                     <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 334                     Require all granted
1da57c 335                     <tmpl_else>
8133de 336                     Order allow,deny
MC 337                     Allow from all
1da57c 338                     </tmpl_if>
52846b 339                 </Directory>
596a60 340                 <Directory {tmpl_var name='web_document_root_www'}>
MC 341                     <FilesMatch "\.php[345]?$">
342                         SetHandler php5-fcgi
343                     </FilesMatch>
344                 </Directory>
345                 <Directory {tmpl_var name='web_document_root'}>
346                     <FilesMatch "\.php[345]?$">
347                         SetHandler php5-fcgi
348                     </FilesMatch>
349                 </Directory>
6ffc75 350                 Action php5-fcgi /php5-fcgi virtual
bfcdef 351                 Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
274362 352 <tmpl_if name='use_tcp'>
cc6568 353                 FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1:<tmpl_var name='fpm_port'> -pass-header Authorization
44fe3b 354                 <IfModule mod_proxy_fcgi.c>
MK 355             ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:<tmpl_var name='fpm_port'><tmpl_var name='web_document_root'>/$1
356                 </IfModule>
274362 357 </tmpl_if>
F 358 <tmpl_if name='use_socket'>
cc6568 359                 FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket <tmpl_var name='fpm_socket'> -pass-header Authorization
274362 360 </tmpl_if>
797215 361         </IfModule>
274362 362 </tmpl_if>
e64fbb 363
c59632 364 <tmpl_if name='php' op='==' value='hhvm'>
MC 365         <IfModule mod_fastcgi.c>
366                 <Directory {tmpl_var name='document_root'}/cgi-bin>
367                     <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
368                     Require all granted
369                     <tmpl_else>
370                     Order allow,deny
371                     Allow from all
372                     </tmpl_if>
373                 </Directory>
596a60 374                 <Directory {tmpl_var name='web_document_root_www'}>
MC 375                     <FilesMatch "\.php[345]?$">
376                         SetHandler hhvm-fcgi
377                     </FilesMatch>
378                     <FilesMatch "\.hh$">
379                         SetHandler hhvm-fcgi
380                     </FilesMatch>
381                 </Directory>
382                 <Directory {tmpl_var name='web_document_root'}>
383                     <FilesMatch "\.php[345]?$">
384                         SetHandler hhvm-fcgi
385                     </FilesMatch>
386                     <FilesMatch "\.hh$">
387                         SetHandler hhvm-fcgi
388                     </FilesMatch>
389                 </Directory>
8edabf 390                 Action hhvm-fcgi /hhvm-fcgi virtual
c04e79 391                 Alias /hhvm-fcgi {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
MC 392                 FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket /var/run/hhvm/hhvm.<tmpl_var name='system_user'>.sock -pass-header Authorization
c59632 393         </IfModule>
MC 394 </tmpl_if>
395
8ab3cd 396 <tmpl_if name="rewrite_enabled">
0305b2 397         RewriteEngine on
3a5909 398 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
MB 399         RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
400         RewriteRule ^ - [END]
401 </tmpl_if>
8ab3cd 402 <tmpl_if name='seo_redirect_enabled'>
bfcdef 403         RewriteCond %{HTTP_HOST} <tmpl_var name='seo_redirect_operator'>^<tmpl_var name='seo_redirect_origin_domain'>$ [NC]
8831af 404         <tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/</tmpl_if>
6acf32 405         RewriteRule ^(.*)$ http<tmpl_if name='ssl_enabled'>s</tmpl_if>://<tmpl_var name='seo_redirect_target_domain'>$1 [R=301,NE,L]
e64fbb 406 </tmpl_if>
bfcdef 407 <tmpl_loop name="alias_seo_redirects">
T 408         RewriteCond %{HTTP_HOST} <tmpl_var name='alias_seo_redirect_operator'>^<tmpl_var name='alias_seo_redirect_origin_domain'>$ [NC]
8831af 409         <tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/</tmpl_if>
6acf32 410         RewriteRule ^(.*)$ http<tmpl_if name='ssl_enabled'>s</tmpl_if>://<tmpl_var name='alias_seo_redirect_target_domain'>$1 [R=301,NE,L]
bfcdef 411 </tmpl_loop>
47cca9 412 <tmpl_loop name="redirects">
0305b2 413         RewriteCond %{HTTP_HOST}   <tmpl_var name='rewrite_domain'>$ [NC]
8831af 414         <tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/</tmpl_if>
046d62 415 <tmpl_if name="rewrite_is_url" op="==" value="n">
M 416         RewriteCond %{REQUEST_URI} !^/webdav/
6f4f6b 417         RewriteCond %{REQUEST_URI} !^/php5-fcgi/
046d62 418         RewriteCond %{REQUEST_URI} !^<tmpl_var name='rewrite_target'>
M 419 </tmpl_if>
6f833c 420         
e6fd35 421         RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'><tmpl_if name="rewrite_add_path" op="==" value="y">$1</tmpl_if>  <tmpl_var name='rewrite_type'>
6f833c 422     
47cca9 423 </tmpl_loop>
f0dfa9 424 <tmpl_if name='ssl_enabled'>
d22277 425 <tmpl_else>
f0dfa9 426 <tmpl_if name='rewrite_to_https' op='==' value='y'>
MC 427         RewriteCond %{HTTPS} off
8831af 428         <tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/</tmpl_if>
f0dfa9 429         RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
MC 430 </tmpl_if>
431 </tmpl_if>
47cca9 432 </tmpl_if>
T 433
0305b2 434         # add support for apache mpm_itk
M 435         <IfModule mpm_itk_module>
436             AssignUserId <tmpl_var name='system_user'> <tmpl_var name='system_group'>
437         </IfModule>
c4570e 438
0305b2 439         <IfModule mod_dav_fs.c>
M 440         # Do not execute PHP files in webdav directory
441             <Directory {tmpl_var name='document_root'}/webdav>
7762fb 442                 <ifModule mod_security2.c>
M 443                     SecRuleRemoveById 960015
444                     SecRuleRemoveById 960032
445                 </ifModule>
446                 <FilesMatch "\.ph(p3?|tml)$">
0305b2 447                     SetHandler None
M 448                 </FilesMatch>
449             </Directory>
450             DavLockDB {tmpl_var name='document_root'}/tmp/DavLock
451             # DO NOT REMOVE THE COMMENTS!
452             # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
453             # WEBDAV BEGIN
454             # WEBDAV END
455         </IfModule>
ac933e 456
47cca9 457 <tmpl_var name='apache_directives'>
216ea1 458 <tmpl_hook name='apache2_vhost:vhost_footer'>
47cca9 459 </VirtualHost>
7c75fc 460
C 461 <tmpl_if name='apache_version' op='>=' value='2.4' format='version'>
462 <tmpl_if name='ssl_enabled'>
463 <IfModule mod_ssl.c>
464         SSLStaplingCache shmcb:/var/run/ocsp(128000)
465 </IfModule>
466 </tmpl_if>
467 </tmpl_if>
468
61bf63 469 </tmpl_loop>
216ea1 470
410055 471 <tmpl_hook name='apache2_vhost:footer'>