Skip to content

Commit f6d7456

Browse files
committed
Comment out the listen directive in the ispconfig.vhost file if the port for ispconfig is 80 or 443.
1 parent 3b528fe commit f6d7456

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,14 @@ public function install_ispconfig()
619619

620620
$content = rf("tpl/apache_ispconfig.vhost.master");
621621
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
622+
623+
// comment out the listen directive if port is 80 or 443
624+
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
625+
$content = str_replace('{vhost_port_listen}', '#', $content);
626+
} else {
627+
$content = str_replace('{vhost_port_listen}', '', $content);
628+
}
629+
622630
wf("$vhost_conf_dir/ispconfig.vhost", $content);
623631

624632
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");

install/dist/lib/opensuse.lib.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,14 @@ public function install_ispconfig()
637637

638638
$content = rf("tpl/apache_ispconfig.vhost.master");
639639
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
640+
641+
// comment out the listen directive if port is 80 or 443
642+
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
643+
$content = str_replace('{vhost_port_listen}', '#', $content);
644+
} else {
645+
$content = str_replace('{vhost_port_listen}', '', $content);
646+
}
647+
640648
wf("$vhost_conf_dir/ispconfig.vhost", $content);
641649

642650
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");

install/lib/installer_base.lib.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,14 @@ public function install_ispconfig()
832832

833833
$content = rf("tpl/apache_ispconfig.vhost.master");
834834
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
835+
836+
// comment out the listen directive if port is 80 or 443
837+
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
838+
$content = str_replace('{vhost_port_listen}', '#', $content);
839+
} else {
840+
$content = str_replace('{vhost_port_listen}', '', $content);
841+
}
842+
835843
wf("$vhost_conf_dir/ispconfig.vhost", $content);
836844

837845
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");

install/tpl/apache_ispconfig.vhost.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# for the ISPConfig controlpanel
55
######################################################
66

7-
Listen {vhost_port}
7+
{vhost_port_listen} Listen {vhost_port}
88
NameVirtualHost *:{vhost_port}
99

1010
<VirtualHost _default_:{vhost_port}>

0 commit comments

Comments
 (0)