Marius Cramer
2014-02-17 ebbe6374fc9c308daf729d2ad1b2f8007ed771ce
commit | author | age
47cca9 1
T 2 <Directory {tmpl_var name='web_basedir'}/{tmpl_var name='domain'}>
0305b2 3         AllowOverride None
1da57c 4         <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 5         Require all deny
1da57c 6         <tmpl_else>
0305b2 7         Order Deny,Allow
M 8         Deny from all
1da57c 9         </tmpl_if>
47cca9 10 </Directory>
T 11
a7bdf8 12 <tmpl_loop name="vhosts">
T 13 <VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name='port'}>
47cca9 14 <tmpl_if name='php' op='==' value='suphp'>
0305b2 15         DocumentRoot <tmpl_var name='web_document_root'>
47cca9 16 </tmpl_else>
0305b2 17     <tmpl_if name='php' op='==' value='cgi'>
M 18         DocumentRoot <tmpl_var name='web_document_root'>
19     </tmpl_else>
cc6568 20         <tmpl_if name='php' op='==' value='php-fpm'>
H 21         DocumentRoot <tmpl_var name='web_document_root'>
22         </tmpl_else>
0305b2 23         DocumentRoot <tmpl_var name='web_document_root_www'>
cc6568 24         </tmpl_if>
0305b2 25     </tmpl_if>
47cca9 26 </tmpl_if>
T 27
0305b2 28         ServerName <tmpl_var name='domain'>
47cca9 29 <tmpl_if name='alias'>
0305b2 30         <tmpl_var name='alias'>
47cca9 31 </tmpl_if>
0305b2 32         ServerAdmin webmaster@<tmpl_var name='domain'>
47cca9 33
0305b2 34         ErrorLog /var/log/ispconfig/httpd/<tmpl_var name='domain'>/error.log
3e0034 35
47cca9 36 <tmpl_if name='errordocs'>
0305b2 37         Alias /error/ "<tmpl_var name='web_document_root_www'>/error/"
M 38         ErrorDocument 400 /error/400.html
39         ErrorDocument 401 /error/401.html
40         ErrorDocument 403 /error/403.html
41         ErrorDocument 404 /error/404.html
42         ErrorDocument 405 /error/405.html
43         ErrorDocument 500 /error/500.html
44         ErrorDocument 502 /error/502.html
45         ErrorDocument 503 /error/503.html
47cca9 46 </tmpl_if>
a7bdf8 47
0305b2 48         <IfModule mod_ssl.c>
a7bdf8 49 <tmpl_if name='ssl_enabled'>
T 50     SSLEngine on
0305b2 51         SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.crt
M 52         SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.key
a7bdf8 53 <tmpl_if name='has_bundle_cert'>
0305b2 54         SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
a7bdf8 55 </tmpl_if>
dec0df 56 </tmpl_if>
0305b2 57         </IfModule>
dec0df 58
0305b2 59         <Directory {tmpl_var name='web_document_root_www'}>
M 60                 Options FollowSymLinks
61                 AllowOverride <tmpl_var name='allow_override'>
1da57c 62                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 63                 Require all granted
1da57c 64                 <tmpl_else>
0305b2 65                 Order allow,deny
M 66                 Allow from all
1da57c 67                 </tmpl_if>
47cca9 68 <tmpl_if name='ssi' op='==' value='y'>
0305b2 69
M 70                 # ssi enabled
71                 AddType text/html .shtml
72                 AddOutputFilter INCLUDES .shtml
73                 Options +Includes
47cca9 74 </tmpl_if>
T 75 <tmpl_if name='php' op='==' value='no'>
0305b2 76                 <Files ~ '.php[s3-6]{0,1}$'>
1da57c 77                         <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 78                         Require all denied
1da57c 79                         <tmpl_else>
0305b2 80                         Order allow,deny
M 81                         Deny from all
82                         Allow from none
1da57c 83                         </tmpl_if>
0305b2 84                 </Files>
47cca9 85 </tmpl_if>
0305b2 86         </Directory>
M 87         <Directory {tmpl_var name='web_document_root'}>
88                 Options FollowSymLinks
89                 AllowOverride <tmpl_var name='allow_override'>
1da57c 90                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 91                 Require all granted
1da57c 92                 <tmpl_else>
0305b2 93                 Order allow,deny
M 94                 Allow from all
1da57c 95                 </tmpl_if>
47cca9 96 <tmpl_if name='ssi' op='==' value='y'>
0305b2 97
M 98                 # ssi enabled
99                 AddType text/html .shtml
100                 AddOutputFilter INCLUDES .shtml
101                 Options +Includes
47cca9 102 </tmpl_if>
07d3a1 103 <tmpl_if name='php' op='==' value='no'>
0305b2 104                 <Files ~ '.php[s3-6]{0,1}$'>
1da57c 105                     <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 106                     Require all denied
1da57c 107                     <tmpl_else>
8133de 108                     Order allow,deny
MC 109                     Deny from all
110                     Allow from none
1da57c 111                     </tmpl_if>
0305b2 112                 </Files>
07d3a1 113 </tmpl_if>
0305b2 114         </Directory>
07d3a1 115
22ef48 116 <tmpl_if name='ruby' op='==' value='y'>
0305b2 117         <IfModule mod_ruby.c>
M 118             <Directory {tmpl_var name='web_document_root_www'}>
119                 Options +ExecCGI
120             </Directory>
121             RubyRequire apache/ruby-run
122             #RubySafeLevel 0
123             AddType text/html .rb
124             AddType text/html .rbx
125             <Files *.rb>
126                 SetHandler ruby-object
127                 RubyHandler Apache::RubyRun.instance
128             </Files>
129             <Files *.rbx>
130                 SetHandler ruby-object
131                 RubyHandler Apache::RubyRun.instance
132             </Files>
133         </IfModule>
22ef48 134 </tmpl_if>
47cca9 135
ab7597 136 <tmpl_if name='perl' op='==' value='y'>
M 137         <IfModule mod_perl.c>
138             PerlModule ModPerl::Registry
139             PerlModule Apache2::Reload
140             <Directory {tmpl_var name='web_document_root_www'}>
141                 PerlResponseHandler ModPerl::Registry
142                 PerlOptions +ParseHeaders
143                 Options +ExecCGI
144             </Directory>
72d6a8 145             <Directory {tmpl_var name='web_document_root'}>
TB 146                 PerlResponseHandler ModPerl::Registry
147                 PerlOptions +ParseHeaders
148                 Options +ExecCGI
149             </Directory>
6fb93d 150             <Files *.pl>
M 151                 SetHandler perl-script
152             </Files>
ab7597 153         </IfModule>
M 154 </tmpl_if>
155
298ef5 156 <tmpl_if name='python' op='==' value='y'>
0305b2 157         <IfModule mod_python.c>
M 158             <Directory {tmpl_var name='web_document_root_www'}>
159                 AddHandler mod_python .py
160                 PythonHandler mod_python.publisher
161                 PythonDebug On
162             </Directory>
163         </IfModule>
298ef5 164 </tmpl_if>
F 165
47cca9 166 <tmpl_if name='cgi' op='==' value='y'>
0305b2 167         # cgi enabled
47cca9 168     <Directory {tmpl_var name='document_root'}/cgi-bin>
1da57c 169             <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 170             Require all granted
1da57c 171             <tmpl_else>
0305b2 172             Order allow,deny
M 173             Allow from all
1da57c 174             </tmpl_if>
0305b2 175         </Directory>
M 176         ScriptAlias  /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
177         AddHandler cgi-script .cgi
178         AddHandler cgi-script .pl
47cca9 179 </tmpl_if>
T 180 <tmpl_if name='suexec' op='==' value='y'>
0305b2 181         # suexec enabled
M 182         <IfModule mod_suexec.c>
183             SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
184         </IfModule>
47cca9 185 </tmpl_if>
0305b2 186         # Clear PHP settings of this website
c0a1a4 187         <FilesMatch ".+\.ph(p[345]?|t|tml)$">
0305b2 188                 SetHandler None
M 189         </FilesMatch>
47cca9 190 <tmpl_if name='php' op='==' value='mod'>
0305b2 191         # mod_php enabled
M 192         AddType application/x-httpd-php .php .php3 .php4 .php5
193         php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
194         php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
195         php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
10f838 196     # PHPIniDir <tmpl_var name='custom_php_ini_dir'>
215d18 197 <tmpl_if name='security_level' op='==' value='20'>
0305b2 198         php_admin_value open_basedir <tmpl_var name='php_open_basedir'>
215d18 199 </tmpl_if>
47cca9 200 </tmpl_if>
T 201 <tmpl_if name='php' op='==' value='suphp'>
0305b2 202         # suphp enabled
M 203         <Directory {tmpl_var name='web_document_root'}>
f8d8a4 204         <IfModule mod_suphp.c>
0305b2 205                 suPHP_Engine on
M 206                 # suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
7fddfe 207 <tmpl_if name='has_custom_php_ini'>
T 208     suPHP_ConfigPath <tmpl_var name='custom_php_ini_dir'>
209 </tmpl_if>
0305b2 210                 AddHandler x-httpd-suphp .php .php3 .php4 .php5
M 211                 suPHP_AddHandler x-httpd-suphp
f8d8a4 212         </IfModule>
0305b2 213         </Directory>
47cca9 214 </tmpl_if>
T 215 <tmpl_if name='php' op='==' value='cgi'>
0305b2 216         # php as cgi enabled
M 217         ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
218         Action php5-cgi /php5-cgi
219         AddHandler php5-cgi .php .php3 .php4 .php5
220         <Directory {tmpl_var name='cgi_starter_path'}>
1da57c 221             <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 222             Require all granted
1da57c 223             <tmpl_else>
8133de 224             Order allow,deny
MC 225             Allow from all
1da57c 226             </tmpl_if>
0305b2 227         </Directory>
47cca9 228 </tmpl_if>
T 229 <tmpl_if name='php' op='==' value='fast-cgi'>
0305b2 230         # php as fast-cgi enabled
8fe84f 231     # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
0305b2 232         <IfModule mod_fcgid.c>
92e0ce 233 <tmpl_if name='fastcgi_config_syntax' op='==' value='2'>
0305b2 234                 FcgidIdleTimeout 300
M 235                 FcgidProcessLifeTime 3600
236                 # FcgidMaxProcesses 1000
bfcdef 237                 FcgidMaxRequestsPerProcess <tmpl_var name='fastcgi_max_requests'>
0305b2 238                 FcgidMinProcessesPerClass 0
310f4c 239                 FcgidMaxProcessesPerClass 10
0305b2 240                 FcgidConnectTimeout 3
2ed8f0 241                 FcgidIOTimeout 600
MC 242                 FcgidBusyTimeout 3600
bfcdef 243                 FcgidMaxRequestLen 1073741824
92e0ce 244 <tmpl_else>
0305b2 245                 IdleTimeout 300
M 246                 ProcessLifeTime 3600
247                 # MaxProcessCount 1000
248                 DefaultMinClassProcessCount 0
249                 DefaultMaxClassProcessCount 100
250                 IPCConnectTimeout 3
2ed8f0 251                 IPCCommTimeout 600
MC 252                 BusyTimeout 3600
92e0ce 253 </tmpl_if>
0305b2 254         </IfModule>
M 255         <Directory {tmpl_var name='web_document_root_www'}>
256                 AddHandler fcgid-script .php .php3 .php4 .php5
257                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
c0a1a4 258                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php3
TB 259                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php4
260                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php5
0305b2 261                 Options +ExecCGI
M 262                 AllowOverride <tmpl_var name='allow_override'>
1da57c 263                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 264                 Require all granted
1da57c 265                 <tmpl_else>
0305b2 266                 Order allow,deny
M 267                 Allow from all
1da57c 268                 </tmpl_if>
0305b2 269         </Directory>
M 270         <Directory {tmpl_var name='web_document_root'}>
271                 AddHandler fcgid-script .php .php3 .php4 .php5
272                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
c0a1a4 273                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php3
TB 274                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php4
275                 FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php5
0305b2 276                 Options +ExecCGI
M 277                 AllowOverride <tmpl_var name='allow_override'>
1da57c 278                 <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 279                 Require all granted
1da57c 280                 <tmpl_else>
0305b2 281                 Order allow,deny
M 282                 Allow from all
1da57c 283                 </tmpl_if>
0305b2 284         </Directory>
47cca9 285 </tmpl_if>
274362 286 <tmpl_if name='php' op='==' value='php-fpm'>
0305b2 287         <IfModule mod_fastcgi.c>
10b4c8 288                 <Directory {tmpl_var name='document_root'}/cgi-bin>
1da57c 289                     <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
8133de 290                     Require all granted
1da57c 291                     <tmpl_else>
8133de 292                     Order allow,deny
MC 293                     Allow from all
1da57c 294                     </tmpl_if>
52846b 295                 </Directory>
c0a1a4 296                 AddHandler php5-fcgi .php .php3 .php4 .php5
52846b 297                 Action php5-fcgi /php5-fcgi
bfcdef 298                 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 299 <tmpl_if name='use_tcp'>
cc6568 300                 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
274362 301 </tmpl_if>
F 302 <tmpl_if name='use_socket'>
cc6568 303                 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 304 </tmpl_if>
0305b2 305         </IfModule>
274362 306 </tmpl_if>
e64fbb 307
8ab3cd 308 <tmpl_if name="rewrite_enabled">
0305b2 309         RewriteEngine on
8ab3cd 310 <tmpl_if name='seo_redirect_enabled'>
bfcdef 311         RewriteCond %{HTTP_HOST} <tmpl_var name='seo_redirect_operator'>^<tmpl_var name='seo_redirect_origin_domain'>$ [NC]
cc6568 312         RewriteRule ^(.*)$ http<tmpl_if name='ssl_enabled'>s</tmpl_if>://<tmpl_var name='seo_redirect_target_domain'>$1 [R=301,L]
e64fbb 313 </tmpl_if>
bfcdef 314 <tmpl_loop name="alias_seo_redirects">
T 315         RewriteCond %{HTTP_HOST} <tmpl_var name='alias_seo_redirect_operator'>^<tmpl_var name='alias_seo_redirect_origin_domain'>$ [NC]
cc6568 316         RewriteRule ^(.*)$ http<tmpl_if name='ssl_enabled'>s</tmpl_if>://<tmpl_var name='alias_seo_redirect_target_domain'>$1 [R=301,L]
bfcdef 317 </tmpl_loop>
47cca9 318 <tmpl_loop name="redirects">
0305b2 319         RewriteCond %{HTTP_HOST}   <tmpl_var name='rewrite_domain'>$ [NC]
046d62 320 <tmpl_if name="rewrite_is_url" op="==" value="n">
M 321         RewriteCond %{REQUEST_URI} !^/webdav/
6f4f6b 322         RewriteCond %{REQUEST_URI} !^/php5-fcgi/
046d62 323         RewriteCond %{REQUEST_URI} !^<tmpl_var name='rewrite_target'>
M 324 </tmpl_if>
68ec43 325         RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'><tmpl_if name="rewrite_add_path" op="==" value="y">$1</tmpl_if>  <tmpl_var name='rewrite_type'>
47cca9 326 </tmpl_loop>
T 327 </tmpl_if>
328
0305b2 329         # add support for apache mpm_itk
M 330         <IfModule mpm_itk_module>
331             AssignUserId <tmpl_var name='system_user'> <tmpl_var name='system_group'>
332         </IfModule>
c4570e 333
0305b2 334         <IfModule mod_dav_fs.c>
M 335         # Do not execute PHP files in webdav directory
336             <Directory {tmpl_var name='document_root'}/webdav>
7762fb 337                 <ifModule mod_security2.c>
M 338                     SecRuleRemoveById 960015
339                     SecRuleRemoveById 960032
340                 </ifModule>
341                 <FilesMatch "\.ph(p3?|tml)$">
0305b2 342                     SetHandler None
M 343                 </FilesMatch>
344             </Directory>
345             DavLockDB {tmpl_var name='document_root'}/tmp/DavLock
346             # DO NOT REMOVE THE COMMENTS!
347             # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
348             # WEBDAV BEGIN
349             # WEBDAV END
350         </IfModule>
ac933e 351
47cca9 352 <tmpl_var name='apache_directives'>
T 353 </VirtualHost>
a7bdf8 354 </tmpl_loop>