Skip to content

Commit 86e3bb9

Browse files
committed
Fixed: FS#591 - Missing NameVirtualHost and IPs after update
1 parent 9157d27 commit 86e3bb9

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,18 @@ public function configure_apache()
426426
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
427427
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
428428

429-
copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
429+
// copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
430+
$content = rf("tpl/apache_ispconfig.conf.master");
431+
$records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'");
432+
if(count($records) > 0) {
433+
foreach($records as $rec) {
434+
$content .= "NameVirtualHost ".$rec["ip_address"].":80\n";
435+
$content .= "NameVirtualHost ".$rec["ip_address"].":443\n";
436+
}
437+
}
438+
$content .= "\n";
439+
wf($vhost_conf_dir.'/ispconfig.conf',$content);
440+
430441
if(!@is_link($vhost_conf_enabled_dir."/000-ispconfig.conf")) {
431442
exec("ln -s ".$vhost_conf_dir."/ispconfig.conf ".$vhost_conf_enabled_dir."/000-ispconfig.conf");
432443
}

install/dist/lib/opensuse.lib.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,18 @@ public function configure_apache()
448448
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
449449
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
450450

451-
copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
451+
//copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
452+
$content = rf("tpl/apache_ispconfig.conf.master");
453+
$records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'");
454+
if(count($records) > 0) {
455+
foreach($records as $rec) {
456+
$content .= "NameVirtualHost ".$rec["ip_address"].":80\n";
457+
$content .= "NameVirtualHost ".$rec["ip_address"].":443\n";
458+
}
459+
}
460+
$content .= "\n";
461+
wf($vhost_conf_dir.'/ispconfig.conf',$content);
462+
452463
if(!@is_link($vhost_conf_enabled_dir."/000-ispconfig.conf")) {
453464
exec("ln -s ".$vhost_conf_dir."/ispconfig.conf ".$vhost_conf_enabled_dir."/000-ispconfig.conf");
454465
}

install/lib/installer_base.lib.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,19 @@ public function configure_apache()
723723
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
724724
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
725725

726-
copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
726+
// copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
727+
728+
$content = rf("tpl/apache_ispconfig.conf.master");
729+
$records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'");
730+
if(count($records) > 0) {
731+
foreach($records as $rec) {
732+
$content .= "NameVirtualHost ".$rec["ip_address"].":80\n";
733+
$content .= "NameVirtualHost ".$rec["ip_address"].":443\n";
734+
}
735+
}
736+
$content .= "\n";
737+
wf($vhost_conf_dir.'/ispconfig.conf',$content);
738+
727739
if(!@is_link($vhost_conf_enabled_dir."/000-ispconfig.conf")) {
728740
exec("ln -s ".$vhost_conf_dir."/ispconfig.conf ".$vhost_conf_enabled_dir."/000-ispconfig.conf");
729741
}

0 commit comments

Comments
 (0)