vhost.conf.master 5.92 KB
Newer Older
tbrehm's avatar
tbrehm committed
1 2

<VirtualHost <tmpl_var name='ip_address'>:80>
redray's avatar
redray committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
<tmpl_if name='php' op='==' value='suphp'>
  DocumentRoot <tmpl_var name='web_document_root'>
</tmpl_else>
  DocumentRoot <tmpl_var name='web_document_root_www'>
</tmpl_if>

  ServerName <tmpl_var name='domain'>
<tmpl_if name='alias'>
  ServerAlias <tmpl_var name='alias'>
</tmpl_if>
  ServerAdmin webmaster@<tmpl_var name='domain'>

  ErrorLog <tmpl_var name='document_root'>/log/error.log
<tmpl_if name='errordocs' op='==' value='y'>
redray's avatar
redray committed
17

18 19 20 21 22 23 24
	ErrorDocument 400 /error/invalidSyntax.html
	ErrorDocument 401 /error/authorizationRequired.html
	ErrorDocument 403 /error/forbidden.html
	ErrorDocument 404 /error/fileNotFound.html
	ErrorDocument 405 /error/methodNotAllowed.html
	ErrorDocument 500 /error/internalServerError.html
	ErrorDocument 503 /error/overloaded.html
redray's avatar
redray committed
25
</tmpl_if>
tbrehm's avatar
tbrehm committed
26

redray's avatar
redray committed
27
  <Directory {tmpl_var name='web_document_root_www'}>
redray's avatar
redray committed
28
      Options FollowSymLinks Indexes
redray's avatar
redray committed
29 30 31
      AllowOverride Indexes AuthConfig Limit FileInfo
      Order allow,deny
      Allow from all
redray's avatar
redray committed
32 33 34 35 36 37 38
<tmpl_if name='ssi' op='==' value='y'>

      # ssi enabled
      AddType text/html .shtml
      AddOutputFilter INCLUDES .shtml
      Options +Includes
</tmpl_if>
redray's avatar
redray committed
39 40
  </Directory>

41
<tmpl_if name='cgi' op='==' value='y'>
redray's avatar
redray committed
42 43 44 45
  # cgi enabled
  ScriptAlias  /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
  AddHandler cgi-script .cgi
  AddHandler cgi-script .pl
tbrehm's avatar
tbrehm committed
46
</tmpl_if>
47
<tmpl_if name='suexec' op='==' value='y'>
redray's avatar
redray committed
48 49
  # suexec enabled
  SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
tbrehm's avatar
tbrehm committed
50 51
</tmpl_if>
<tmpl_if name='php' op='==' value='mod'>
redray's avatar
redray committed
52 53
  # mod_php enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
54 55
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
redray's avatar
redray committed
56 57 58 59 60 61 62
  # suphp enabled
  <Directory {tmpl_var name='web_document_root'}>
      suPHP_Engine on
      # suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
      AddHandler x-httpd-suphp .php .php3 .php4 .php5
      suPHP_AddHandler x-httpd-suphp
  </Directory>
tbrehm's avatar
tbrehm committed
63 64
</tmpl_if>
<tmpl_if name='php' op='==' value='cgi'>
redray's avatar
redray committed
65 66
  # php as cgi enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
67
</tmpl_if>
daniel's avatar
daniel committed
68
<tmpl_if name='php' op='==' value='fast-cgi'>
redray's avatar
redray committed
69 70 71 72
  # php as fast-cgi enabled
  <Directory {tmpl_var name='web_document_root_www'}>
      AddHandler fcgid-script .php .php3 .php4 .php5
      FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
redray's avatar
redray committed
73
      Options +ExecCGI
redray's avatar
redray committed
74 75 76 77
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>
daniel's avatar
daniel committed
78
</tmpl_if>
tbrehm's avatar
tbrehm committed
79
<tmpl_if name="rewrite_enabled">
redray's avatar
redray committed
80 81

  RewriteEngine on
tbrehm's avatar
tbrehm committed
82
<tmpl_loop name="redirects">
redray's avatar
redray committed
83 84
  RewriteCond %{HTTP_HOST}   ^<tmpl_var name='rewrite_domain'> [NC]
  RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'>$1  [<tmpl_var name='rewrite_type'>]
tbrehm's avatar
tbrehm committed
85
</tmpl_loop>
tbrehm's avatar
tbrehm committed
86
</tmpl_if>
redray's avatar
redray committed
87
<tmpl_if name='php' op='!=' value=''>
tbrehm's avatar
tbrehm committed
88

redray's avatar
redray committed
89
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"	
redray's avatar
redray committed
90 91 92
  #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
  #php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  #php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
redray's avatar
redray committed
93
</tmpl_if>
tbrehm's avatar
tbrehm committed
94
<tmpl_var name='apache_directives'>
tbrehm's avatar
tbrehm committed
95 96 97 98
</VirtualHost>



tbrehm's avatar
tbrehm committed
99 100
<tmpl_if name='ssl_enabled'>
<IfModule mod_ssl.c>
tbrehm's avatar
tbrehm committed
101 102 103 104 105
###########################################################
# SSL Vhost
###########################################################

<VirtualHost <tmpl_var name='ip_address'>:443>
redray's avatar
redray committed
106 107 108 109 110 111 112 113
  DocumentRoot <tmpl_var name='web_document_root'>
  ServerName <tmpl_var name='domain'>
<tmpl_if name='alias'>
  ServerAlias <tmpl_var name='alias'>
</tmpl_if>
  ServerAdmin webmaster@<tmpl_var name='domain'>
  
  ErrorLog <tmpl_var name='document_root'>/log/error.log
redray's avatar
redray committed
114

redray's avatar
redray committed
115
<tmpl_if name='errordocs' op='==' value='y'>
tbrehm's avatar
tbrehm committed
116 117 118 119 120 121 122
	ErrorDocument 400 /error/invalidSyntax.html
	ErrorDocument 401 /error/authorizationRequired.html
	ErrorDocument 403 /error/forbidden.html
	ErrorDocument 404 /error/fileNotFound.html
	ErrorDocument 405 /error/methodNotAllowed.html
	ErrorDocument 500 /error/internalServerError.html
	ErrorDocument 503 /error/overloaded.html
redray's avatar
redray committed
123 124

</tmpl_if>
tbrehm's avatar
tbrehm committed
125
	SSLEngine on
tbrehm's avatar
tbrehm committed
126 127
	SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.crt
	SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.key
tbrehm's avatar
tbrehm committed
128
<tmpl_if name='has_bundle_cert'>
tbrehm's avatar
tbrehm committed
129
	SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.bundle
tbrehm's avatar
tbrehm committed
130
</tmpl_if>
tbrehm's avatar
tbrehm committed
131 132

<tmpl_if name='cgi'>
redray's avatar
redray committed
133 134 135 136
  # cgi enabled
  ScriptAlias  /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
  AddHandler cgi-script .cgi
  AddHandler cgi-script .pl
tbrehm's avatar
tbrehm committed
137 138
</tmpl_if>
<tmpl_if name='ssi'>
redray's avatar
redray committed
139 140 141
  # ssi enabled
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
tbrehm's avatar
tbrehm committed
142 143
</tmpl_if>
<tmpl_if name='suexec'>
redray's avatar
redray committed
144 145
  # suexec enabled
  SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
tbrehm's avatar
tbrehm committed
146 147
</tmpl_if>
<tmpl_if name='php' op='==' value='mod'>
redray's avatar
redray committed
148 149
  # mod_php enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
150 151
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
redray's avatar
redray committed
152 153 154 155 156
  # suphp enabled
  suPHP_Engine on
  suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
  AddHandler x-httpd-php .php .php3 .php4 .php5
  suPHP_AddHandler x-httpd-php
tbrehm's avatar
tbrehm committed
157 158
</tmpl_if>
<tmpl_if name='php' op='==' value='cgi'>
redray's avatar
redray committed
159 160
  # php as cgi enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
161 162 163
</tmpl_if>

<tmpl_if name="rewrite_enabled">
redray's avatar
redray committed
164 165

  RewriteEngine on
tbrehm's avatar
tbrehm committed
166
<tmpl_loop name="redirects">
redray's avatar
redray committed
167 168 169

  RewriteCond %{HTTP_HOST}   ^<tmpl_var name='rewrite_domain'> [NC]
  RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'>$1  [<tmpl_var name='rewrite_type'>]
tbrehm's avatar
tbrehm committed
170 171
</tmpl_loop>
</tmpl_if>
redray's avatar
redray committed
172 173 174
<tmpl_if name='php' op='!=' value=''>

  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"	
redray's avatar
redray committed
175 176 177
  #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
  #php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  #php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
redray's avatar
redray committed
178
</tmpl_if>
tbrehm's avatar
tbrehm committed
179

180 181
<tmpl_var name='apache_directives'>

tbrehm's avatar
tbrehm committed
182
</VirtualHost>
tbrehm's avatar
tbrehm committed
183
</IfModule>
tbrehm's avatar
tbrehm committed
184 185

</tmpl_if>