don't create a full vhost for every ip/port, just put all the ip's in the <virtualhost>-tag

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-09-30 08:50:18 +02:00
parent f9459e92e7
commit de16c9c4a0

View File

@@ -633,15 +633,16 @@ class apache
$vhost_content = '';
$result = $this->db->query($query);
$ipportlist = '';
while ($ipandport = $this->db->fetch_array($result)) {
$ipport = '';
$domain['ip'] = $ipandport['ip'];
$domain['port'] = $ipandport['port'];
if ($domain['ssl'] == '1') {
$domain['ssl_cert_file'] = $ipandport['ssl_cert_file'];
$domain['ssl_key_file'] = $ipandport['ssl_key_file'];
$domain['ssl_ca_file'] = $ipandport['ssl_ca_file'];
// #418
$domain['ssl_cert_chainfile'] = $ipandport['ssl_cert_chainfile'];
// SSL STUFF
@@ -649,6 +650,7 @@ class apache
// this sets the ssl-related array-indices in the $domain array
// if the domain has customer-defined ssl-certificates
$dssl->setDomainSSLFilesArray($domain);
}
if (filter_var($domain['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$ipport = '['.$domain['ip'].']:'.$domain['port']. ' ';
@@ -656,7 +658,10 @@ class apache
$ipport = $domain['ip'].':'.$domain['port'].' ';
}
$vhost_content .= '<VirtualHost ' . $ipport . '>' . "\n";
$ipportlist .= $ipport;
}
$vhost_content .= '<VirtualHost ' . trim($ipportlist) . '>' . "\n";
$vhost_content.= $this->getServerNames($domain);
if(($ssl_vhost == false
@@ -700,7 +705,6 @@ class apache
$domain['ssl_ca_file'] = $this->settings['system']['ssl_ca_file'];
}
// #418
if ($domain['ssl_cert_chainfile'] == '') {
$domain['ssl_cert_chainfile'] = $this->settings['system']['ssl_cert_chainfile'];
}
@@ -724,7 +728,6 @@ class apache
if ($domain['ssl_cert_chainfile'] != '') {
$vhost_content .= ' SSLCertificateChainFile ' . makeCorrectFile($domain['ssl_cert_chainfile']) . "\n";
}
}
}
@@ -773,8 +776,6 @@ class apache
$vhost_content .= '</VirtualHost>' . "\n";
} // while ip's
return $vhost_content;
}