Skip to content
vhost.conf.master 8.69 KiB
Newer Older
<Directory /var/www/{tmpl_var name='domain'}>
    AllowOverride None
    Order Deny,Allow
    Deny from all
</Directory>

<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'>
redray's avatar
redray committed
</tmpl_else>
  <tmpl_if name='php' op='==' value='cgi'>
    DocumentRoot <tmpl_var name='web_document_root'>
  </tmpl_else>
    DocumentRoot <tmpl_var name='web_document_root_www'>
  </tmpl_if>
redray's avatar
redray committed
</tmpl_if>

    ServerName <tmpl_var name='domain'>
redray's avatar
redray committed
<tmpl_if name='alias'>
    ServerAlias <tmpl_var name='alias'>
redray's avatar
redray committed
</tmpl_if>
    ServerAdmin webmaster@<tmpl_var name='domain'>
redray's avatar
redray committed

tbrehm's avatar
tbrehm committed
    ErrorLog /var/log/ispconfig/httpd/<tmpl_var name='domain'>/error.log
<tmpl_if name='errordocs'>
redray's avatar
redray committed

    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html
redray's avatar
redray committed
</tmpl_if>
    <Directory {tmpl_var name='web_document_root_www'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
redray's avatar
redray committed
<tmpl_if name='ssi' op='==' value='y'>
        
        # ssi enabled
        AddType text/html .shtml
        AddOutputFilter INCLUDES .shtml
        Options +Includes
tbrehm's avatar
tbrehm committed
</tmpl_if>
tbrehm's avatar
tbrehm committed
<tmpl_if name='php' op='==' value='no'>
        <Files ~ '.php$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php3$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php4$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php5$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.phps'>
            Order deny,allow
            Allow from all
        </Files>
</tmpl_if>
    </Directory>
	<Directory {tmpl_var name='web_document_root'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
<tmpl_if name='ssi' op='==' value='y'>
        
        # ssi enabled
        AddType text/html .shtml
        AddOutputFilter INCLUDES .shtml
        Options +Includes
</tmpl_if>
tbrehm's avatar
tbrehm committed
<tmpl_if name='php' op='==' value='no'>
        <Files ~ '.php$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php3$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php4$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.php5$'>
            Order allow,deny
            Deny from all
            Allow from none
        </Files>
        <Files ~ '.phps'>
            Order deny,allow
            Allow from all
        </Files>
redray's avatar
redray committed
</tmpl_if>
redray's avatar
redray committed

<tmpl_if name='cgi' op='==' value='y'>
    # 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='suexec' op='==' value='y'>
    # 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'>
    # mod_php enabled
    AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
	php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"	
    php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
    php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
    #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
    # 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'>
    ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
tbrehm's avatar
tbrehm committed
    Action php5-cgi /php5-cgi
    AddHandler php5-cgi .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
daniel's avatar
daniel committed
<tmpl_if name='php' op='==' value='fast-cgi'>
    # 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 +ExecCGI
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
daniel's avatar
daniel committed
</tmpl_if>
<tmpl_if name="rewrite_enabled">
tbrehm's avatar
tbrehm committed
<tmpl_loop name="redirects">
    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>
<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>
<tmpl_if name='php' op='==' value='suphp'>
    DocumentRoot <tmpl_var name='web_document_root'>
</tmpl_else>
  <tmpl_if name='php' op='==' value='cgi'>
    DocumentRoot <tmpl_var name='web_document_root'>
  </tmpl_else>
    DocumentRoot <tmpl_var name='web_document_root_www'>
  </tmpl_if>
</tmpl_if>

    ServerName <tmpl_var name='domain'>
redray's avatar
redray committed
<tmpl_if name='alias'>
    ServerAlias <tmpl_var name='alias'>
redray's avatar
redray committed
</tmpl_if>
    ServerAdmin webmaster@<tmpl_var name='domain'>
    
tbrehm's avatar
tbrehm committed
    ErrorLog /var/log/ispconfig/httpd/<tmpl_var name='domain'>/error.log
redray's avatar
redray committed

<tmpl_if name='errordocs'>
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html

</tmpl_if>
    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'op='==' value='y'>
    # 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'>
    # ssi enabled
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='suexec'op='==' value='y'>
    # 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'>
    # mod_php enabled
    AddType application/x-httpd-php .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
	php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"	
    php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
    php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
    #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='suphp'>
    # 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'>
    ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
tbrehm's avatar
tbrehm committed
    Action php5-cgi /php5-cgi
    AddHandler php5-cgi .php .php3 .php4 .php5
tbrehm's avatar
tbrehm committed
</tmpl_if>
<tmpl_if name='php' op='==' value='fast-cgi'>
    # 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 +ExecCGI
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
tbrehm's avatar
tbrehm committed
<tmpl_if name="rewrite_enabled">
tbrehm's avatar
tbrehm committed
<tmpl_loop name="redirects">
    
    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>

<tmpl_var name='apache_directives'>
tbrehm's avatar
tbrehm committed
</VirtualHost>
tbrehm's avatar
tbrehm committed
</IfModule>
tbrehm's avatar
tbrehm committed

</tmpl_if>