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