ftimme
2011-10-13 af486448586d3a97f3951d876671626381c0c6c3
- Fixed #1798.
2 files modified
80 ■■■■■ changed files
server/conf/vhost.conf.master 48 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 32 ●●●● patch | view | raw | blame | history
server/conf/vhost.conf.master
@@ -174,23 +174,23 @@
    # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
    <IfModule mod_fcgid.c>
<tmpl_if name='fastcgi_config_syntax' op='==' value='2'>
      FcgidIdleTimeout 300
      FcgidProcessLifeTime 3600
      FcgidMaxProcesses 1000
      FcgidMinProcessesPerClass 0
      FcgidMaxProcessesPerClass 100
      FcgidConnectTimeout 3
      FcgidIOTimeout 360
      FcgidBusyTimeout 300
        FcgidIdleTimeout 300
        FcgidProcessLifeTime 3600
        FcgidMaxProcesses 1000
        FcgidMinProcessesPerClass 0
        FcgidMaxProcessesPerClass 100
        FcgidConnectTimeout 3
        FcgidIOTimeout 360
        FcgidBusyTimeout 300
<tmpl_else>
      IdleTimeout 300
      ProcessLifeTime 3600
      # MaxProcessCount 1000
      DefaultMinClassProcessCount 0
      DefaultMaxClassProcessCount 100
      IPCConnectTimeout 3
      IPCCommTimeout 360
      BusyTimeout 300
        IdleTimeout 300
        ProcessLifeTime 3600
        # MaxProcessCount 1000
        DefaultMinClassProcessCount 0
        DefaultMaxClassProcessCount 100
        IPCConnectTimeout 3
        IPCCommTimeout 360
        BusyTimeout 300
</tmpl_if>
    </IfModule>
    <Directory {tmpl_var name='web_document_root_www'}>
@@ -201,7 +201,7 @@
        Order allow,deny
        Allow from all
    </Directory>
    <Directory {tmpl_var name='web_document_root'}>
    <Directory {tmpl_var name='web_document_root'}>
        AddHandler fcgid-script .php .php3 .php4 .php5
        FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
        Options +ExecCGI
@@ -210,17 +210,13 @@
        Allow from all
    </Directory>
</tmpl_if>
<tmpl_if name="rewrite_enabled">
    RewriteEngine on
<tmpl_if name='seo_redirect_enabled'>
<tmpl_if name="rewrite_enabled">
    RewriteEngine on
<tmpl_if name='seo_redirect_enabled'>
    RewriteCond %{HTTP_HOST} ^<tmpl_var name='seo_redirect_origin_domain'>$ [NC]
    RewriteRule ^(.*)$ http://<tmpl_var name='seo_redirect_target_domain'>/$1 [R=301,L]
</tmpl_if>
<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'>
@@ -234,11 +230,11 @@
    <IfModule mod_dav_fs.c>
      # Do not execute PHP files in webdav directory
      <Directory {tmpl_var name='document_root'}/webdav>
      <Directory {tmpl_var name='document_root'}/webdav>
        <FilesMatch "\.ph(p3?|tml)$">
          SetHandler None
        </FilesMatch>
      </Directory>
      </Directory>
      # DO NOT REMOVE THE COMMENTS!
      # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
server/plugins-available/apache2_plugin.inc.php
@@ -827,12 +827,13 @@
            $tpl->setVar('alias','');
        }
        if(count($rewrite_rules) > 0) {
        if(count($rewrite_rules) > 0 || $vhost_data['seo_redirect_enabled'] > 0) {
            $tpl->setVar('rewrite_enabled',1);
        } else {
            $tpl->setVar('rewrite_enabled',0);
        }
        $tpl->setLoop('redirects',$rewrite_rules);
        //$tpl->setLoop('redirects',$rewrite_rules);
        /**
         * install fast-cgi starter script and add script aliasd config
@@ -957,22 +958,39 @@
        //* create empty vhost array
        $vhosts = array();
        
        //* Add vhost for ipv4 IP
        $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80 );
        //* Add vhost for ipv4 IP
        if(count($rewrite_rules) > 0){
            $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80, 'redirects' => $rewrite_rules);
        } else {
            $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80);
        }
        
        //* Add vhost for ipv4 IP with SSL
        if($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file) && (@filesize($crt_file)>0)  && (@filesize($key_file)>0)) {
            $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443' );
            if(count($rewrite_rules) > 0){
                $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443', 'redirects' => $rewrite_rules);
            } else {
                $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443');
            }
            $app->log('Enable SSL for: '.$domain,LOGLEVEL_DEBUG);
        }
        
        //* Add vhost for IPv6 IP
        if($data['new']['ipv6_address'] != '') {
            $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80 );
            if(count($rewrite_rules) > 0){
                $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80, 'redirects' => $rewrite_rules);
            } else {
                $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80);
            }
        
            //* Add vhost for ipv6 IP with SSL
            if($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file) && (@filesize($crt_file)>0)  && (@filesize($key_file)>0)) {
                $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 1, 'port' => '443' );
                if(count($rewrite_rules) > 0){
                    $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 1, 'port' => '443', 'redirects' => $rewrite_rules);
                } else {
                    $vhosts[] = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 1, 'port' => '443');
                }
                $app->log('Enable SSL for IPv6: '.$domain,LOGLEVEL_DEBUG);
            }
        }