Skip to content
Snippets Groups Projects
Commit 7452b296 authored by Marius Cramer's avatar Marius Cramer
Browse files

Merge branch 'stable-3.0.5' of /home/git/repositories/pixcept/ispconfig3 into stable-3.0.5

parents 80b5debe 8eca284f
No related branches found
No related tags found
No related merge requests found
......@@ -666,6 +666,23 @@ function removeLine($filename, $search_pattern, $strict = 0) {
}
}
function hasLine($filename, $search_pattern, $strict = 0) {
if($lines = @file($filename)) {
foreach($lines as $line) {
if($strict == 0) {
if(stristr($line, $search_pattern)) {
return true;
}
} else {
if(trim($line) == $search_pattern) {
return true;
}
}
}
}
return false;
}
function is_installed($appname) {
exec('which '.escapeshellcmd($appname).' 2> /dev/null', $out, $returncode);
if(isset($out[0]) && stristr($out[0], $appname) && $returncode == 0) {
......
......@@ -1225,6 +1225,15 @@ class installer_base {
replaceLine('/etc/apache2/ports.conf', 'Listen 443', 'Listen 443', 1);
}
if(is_file('/etc/apache2/apache.conf')) {
if(hasLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 1) == false) {
if(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.conf', 1) == false) {
replaceLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 'Include sites-enabled/', 1, 1);
} elseif(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 1) == false) {
replaceLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 'IncludeOptional sites-enabled/*.vhost', 1, 1);
}
}
}
//* Copy the ISPConfig configuration include
$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