Skip to content
Snippets Groups Projects
Commit b9dbe75a authored by tbrehm's avatar tbrehm
Browse files

Fixed: When an SSL web site is created, configure Apache automatically to...

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.
parent 98cfe5dd
No related branches found
No related tags found
No related merge requests found
...@@ -530,6 +530,9 @@ function replaceLine($filename,$search_pattern,$new_line,$strict = 0) { ...@@ -530,6 +530,9 @@ function replaceLine($filename,$search_pattern,$new_line,$strict = 0) {
} }
} }
if($found == 0) { if($found == 0) {
//* add \n if the last line does not end with \n or \r
if(substr($out,-1) != "\n" && substr($out,-1) != "\r") $out .= "\n";
//* add the new line at the end of the file
$out .= $new_line."\n"; $out .= $new_line."\n";
} }
file_put_contents($filename,$out); file_put_contents($filename,$out);
......
...@@ -706,6 +706,11 @@ class installer_base { ...@@ -706,6 +706,11 @@ class installer_base {
replaceLine('/etc/apache2/sites-available/000-default','<VirtualHost *>','<VirtualHost *:80>',1); replaceLine('/etc/apache2/sites-available/000-default','<VirtualHost *>','<VirtualHost *:80>',1);
} }
if(is_file('/etc/apache2/ports.conf')) {
// add a line "Listen 443" to ports conf if line does not exist
replaceLine('/etc/apache2/ports.conf','Listen 443','Listen 443',1);
}
//* Copy the ISPConfig configuration include //* Copy the ISPConfig configuration include
$vhost_conf_dir = $conf['apache']['vhost_conf_dir']; $vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment