Skip to content

Commit f354627

Browse files
author
Marius Burkard
committed
Merge branch 'develop' into '5767-installer-does-not-issue-le-certificate'
# Conflicts: # install/install.php # install/lib/installer_base.lib.php # install/update.php
2 parents ebcab35 + 671b5de commit f354627

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

install/install.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@
536536
$inst->configure_fail2ban();
537537
}
538538

539+
// create acme vhost
540+
if($conf['nginx']['installed'] == true) {
541+
$inst->make_acme_vhost('nginx'); // we need this config file but we don't want nginx to be restarted at this point
542+
}
543+
if($conf['apache']['installed'] == true) {
544+
$inst->make_acme_vhost('apache'); // we need this config file but we don't want apache to be restarted at this point
545+
}
546+
539547
//** Configure ISPConfig :-)
540548
$issue_tried = false;
541549
$install_ispconfig_interface_default = ($conf['mysql']['master_slave_setup'] == 'y')?'n':'y';

install/lib/installer_base.lib.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,9 +2721,15 @@ private function curl_request($url, $use_ipv6 = false) {
27212721
return $response;
27222722
}
27232723

2724-
private function make_acme_vhost($server_name, $server = 'apache', $restart = true) {
2724+
private function make_acme_vhost($server = 'apache') {
27252725
global $conf;
27262726

2727+
if($conf['hostname'] !== 'localhost' && $conf['hostname'] !== '') {
2728+
$server_name = $conf['hostname'];
2729+
} else {
2730+
$server_name = exec('hostname -f');
2731+
}
2732+
27272733
$use_template = 'apache_acme.conf.master';
27282734
$use_symlink = '999-acme.conf';
27292735
$use_name = 'acme.conf';
@@ -2759,15 +2765,6 @@ private function make_acme_vhost($server_name, $server = 'apache', $restart = tr
27592765
if(!@is_link($vhost_conf_enabled_dir.'' . $use_symlink)) {
27602766
symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enabled_dir.'/' . $use_symlink);
27612767
}
2762-
if($restart === true) {
2763-
if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') {
2764-
if($this->is_update) {
2765-
system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null');
2766-
} else {
2767-
system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null');
2768-
}
2769-
}
2770-
}
27712768
}
27722769

27732770
public function make_ispconfig_ssl_cert() {
@@ -2899,15 +2896,22 @@ public function make_ispconfig_ssl_cert() {
28992896
// first of all create the acme vhosts if not existing
29002897
if($conf['nginx']['installed'] == true) {
29012898
swriteln('Using nginx for certificate validation');
2902-
$this->make_acme_vhost($hostname, 'nginx');
2899+
$server = 'nginx';
29032900
} elseif($conf['apache']['installed'] == true) {
29042901
swriteln('Using apache for certificate validation');
29052902
if($this->is_update == false && @is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) {
29062903
$restore_conf_symlink = true;
29072904
unlink($vhost_conf_enabled_dir.'/000-ispconfig.conf');
29082905
}
2906+
$server = 'apache';
2907+
}
29092908

2910-
$this->make_acme_vhost($hostname, 'apache');
2909+
if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') {
2910+
if($this->is_update) {
2911+
system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null');
2912+
} else {
2913+
system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null');
2914+
}
29112915
}
29122916

29132917
$issued_successfully = false;
@@ -3005,9 +3009,6 @@ public function make_ispconfig_ssl_cert() {
30053009
}
30063010
}
30073011
} else {
3008-
if($conf['apache']['installed'] == true) {
3009-
$this->make_acme_vhost($hostname, 'apache', false); // we need this config file but we don't want apache to be restarted at this point
3010-
}
30113012
if($ip_address_match) {
30123013
// the directory already exists so we have to assume that it was created previously
30133014
$issued_successfully = true;

install/update.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,14 @@
520520
swriteln('Updating ISPConfig');
521521

522522
$issue_tried = false;
523+
// create acme vhost
524+
if($conf['nginx']['installed'] == true) {
525+
$inst->make_acme_vhost('nginx'); // we need this config file but we don't want nginx to be restarted at this point
526+
}
527+
if($conf['apache']['installed'] == true) {
528+
$inst->make_acme_vhost('apache'); // we need this config file but we don't want apache to be restarted at this point
529+
}
530+
523531
if ($inst->install_ispconfig_interface) {
524532
//** Customise the port ISPConfig runs on
525533
$ispconfig_port_number = get_ispconfig_port_number();

0 commit comments

Comments
 (0)