Skip to content
vhost.conf.master 5.13 KiB
Newer Older

<VirtualHost <tmpl_var name='ip_address'>:80>
redray's avatar
redray committed
<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'>
	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
</tmpl_if>	
  <Directory {tmpl_var name='web_document_root_www'}>
      Options None
      AllowOverride Indexes AuthConfig Limit FileInfo
      Order allow,deny
      Allow from all
  </Directory>

<tmpl_if name='cgi' op='==' value='y'>
redray's avatar
redray committed
  # 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
</tmpl_if>
<tmpl_if name='ssi' op='==' value='y'>
redray's avatar
redray committed
  # ssi enabled
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='suexec' op='==' value='y'>
redray's avatar
redray committed
  # suexec enabled
  SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='mod'>
redray's avatar
redray committed
  # mod_php enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
redray's avatar
redray committed
  # 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
</tmpl_if>
<tmpl_if name='php' op='==' value='cgi'>
redray's avatar
redray committed
  # php as cgi enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
daniel's avatar
daniel committed
<tmpl_if name='php' op='==' value='fast-cgi'>
redray's avatar
redray committed
  # 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
      Options FollowSymLinks +ExecCGI Indexes
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>
daniel's avatar
daniel committed
</tmpl_if>
<tmpl_if name="rewrite_enabled">
redray's avatar
redray committed

  RewriteEngine on
tbrehm's avatar
tbrehm committed
<tmpl_loop name="redirects">
redray's avatar
redray committed

  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
</tmpl_loop>
</tmpl_if>
tbrehm's avatar
tbrehm committed
<tmpl_var name='apache_directives'>

tbrehm's avatar
tbrehm committed
</VirtualHost>



tbrehm's avatar
tbrehm committed
<tmpl_if name='ssl_enabled'>

<IfModule mod_ssl.c>
tbrehm's avatar
tbrehm committed
###########################################################
# SSL Vhost
###########################################################

<VirtualHost <tmpl_var name='ip_address'>:443>
redray's avatar
redray committed
  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
tbrehm's avatar
tbrehm committed
	
redray's avatar
redray committed
<tmpl_if name='errordocs' op='==' value='y'>
tbrehm's avatar
tbrehm committed
	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

</tmpl_if>
tbrehm's avatar
tbrehm committed
	SSLEngine on
	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
<tmpl_if name='has_bundle_cert'>
	SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.bundle
tbrehm's avatar
tbrehm committed
</tmpl_if>
tbrehm's avatar
tbrehm committed

<tmpl_if name='cgi'>
redray's avatar
redray committed
  # 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
</tmpl_if>
<tmpl_if name='ssi'>
redray's avatar
redray committed
  # ssi enabled
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='suexec'>
redray's avatar
redray committed
  # suexec enabled
  SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='mod'>
redray's avatar
redray committed
  # mod_php enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
redray's avatar
redray committed
  # 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
</tmpl_if>
<tmpl_if name='php' op='==' value='cgi'>
redray's avatar
redray committed
  # php as cgi enabled
  AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>

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

  RewriteEngine on
tbrehm's avatar
tbrehm committed
<tmpl_loop name="redirects">
redray's avatar
redray committed

  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
</tmpl_loop>
</tmpl_if>

</VirtualHost>
tbrehm's avatar
tbrehm committed
</IfModule>
tbrehm's avatar
tbrehm committed

</tmpl_if>