Skip to content

Commit 9e9e080

Browse files
author
Marius Burkard
committed
- remove and restore symlink in apache
1 parent 1392353 commit 9e9e080

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

install/lib/installer_base.lib.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,10 +2846,21 @@ public function make_ispconfig_ssl_cert() {
28462846
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
28472847
$acme = reset($acme);
28482848

2849+
$restore_conf_symlink = false;
2850+
2851+
// we only need this for apache, so use fixed conf index
2852+
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
2853+
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
2854+
28492855
// first of all create the acme vhosts if not existing
28502856
if($conf['nginx']['installed'] == true) {
28512857
$this->make_acme_vhost($hostname, 'nginx');
28522858
} elseif($conf['apache']['installed'] == true) {
2859+
if($this->is_update == false && @is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) {
2860+
$restore_conf_symlink = true;
2861+
unlink($vhost_conf_enabled_dir.'/000-ispconfig.conf');
2862+
}
2863+
28532864
$this->make_acme_vhost($hostname, 'apache');
28542865
}
28552866

@@ -2896,6 +2907,12 @@ public function make_ispconfig_ssl_cert() {
28962907
exec("$le_client $certonly $acme_version --standalone --email postmaster@$hostname -d $hostname $hook");
28972908
}
28982909
}
2910+
2911+
if($restore_conf_symlink) {
2912+
if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) {
2913+
symlink($vhost_conf_dir.'/ispconfig.conf', $vhost_conf_enabled_dir.'/000-ispconfig.conf');
2914+
}
2915+
}
28992916
}
29002917

29012918
//* Define and check ISPConfig SSL folder */

0 commit comments

Comments
 (0)