Skip to content

Commit b9dbe75

Browse files
committed
Fixed: When an SSL web site is created, configure Apache automatically to listen on port 443, if it is not already listening on that port.
1 parent 98cfe5d commit b9dbe75

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

install/lib/install.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ function replaceLine($filename,$search_pattern,$new_line,$strict = 0) {
530530
}
531531
}
532532
if($found == 0) {
533+
//* add \n if the last line does not end with \n or \r
534+
if(substr($out,-1) != "\n" && substr($out,-1) != "\r") $out .= "\n";
535+
//* add the new line at the end of the file
533536
$out .= $new_line."\n";
534537
}
535538
file_put_contents($filename,$out);

install/lib/installer_base.lib.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,11 @@ public function configure_apache()
706706
replaceLine('/etc/apache2/sites-available/000-default','<VirtualHost *>','<VirtualHost *:80>',1);
707707
}
708708

709+
if(is_file('/etc/apache2/ports.conf')) {
710+
// add a line "Listen 443" to ports conf if line does not exist
711+
replaceLine('/etc/apache2/ports.conf','Listen 443','Listen 443',1);
712+
}
713+
709714

710715
//* Copy the ISPConfig configuration include
711716
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];

0 commit comments

Comments
 (0)