diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 91b36965983010f62c730e22247340f63283836c..0e0dbe84461e0db9186fff8c4afcf59bfd0bbd11 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -2718,7 +2718,7 @@ class installer_base { return $response; } - private function make_acme_vhost($server_name, $server = 'apache') { + private function make_acme_vhost($server_name, $server = 'apache', $restart = true) { global $conf; $use_template = 'apache_acme.conf.master'; @@ -2756,12 +2756,13 @@ class installer_base { if(!@is_link($vhost_conf_enabled_dir.'' . $use_symlink)) { symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enabled_dir.'/' . $use_symlink); } - - if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') { - if($this->is_update) { - system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); - } else { - system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + if($restart === true) { + if($conf[$server]['installed'] == true && $conf[$server]['init_script'] != '') { + if($this->is_update) { + system($this->getinitcommand($conf[$server]['init_script'], 'force-reload').' &> /dev/null || ' . $this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + } else { + system($this->getinitcommand($conf[$server]['init_script'], 'restart').' &> /dev/null'); + } } } } @@ -2994,9 +2995,14 @@ class installer_base { symlink($vhost_conf_dir.'/ispconfig.conf', $vhost_conf_enabled_dir.'/000-ispconfig.conf'); } } - } elseif(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))) { - // the directory already exists so we have to assume that it was created previously - $issued_successfully = true; + } else { + if($conf['apache']['installed'] == true) { + $this->make_acme_vhost($hostname, 'apache', false); // we need this config file but we don't want apache to be restarted at this point + } + if(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))) { + // the directory already exists so we have to assume that it was created previously + $issued_successfully = true; + } } // If the LE SSL certs for this hostname exists diff --git a/install/tpl/apache_acme.conf.master b/install/tpl/apache_acme.conf.master index 4a1629433525ca40208b9e9e4db66f8f4d5730d2..38a68d29ead9db31af97623650f51f64bd59952f 100644 --- a/install/tpl/apache_acme.conf.master +++ b/install/tpl/apache_acme.conf.master @@ -1,11 +1,13 @@ - Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge - - <Directory /usr/local/ispconfig/interface/acme> - AllowOverride None +Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge +<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> <tmpl_if name='apache_version' op='>' value='2.2' format='version'> Require all granted <tmpl_else> - Order allow,deny - Allow from all + Order allow,deny + Allow from all </tmpl_if> - </Directory> + <IfModule mpm_itk_module> + AssignUserId ispconfig ispconfig + </IfModule> +</Directory> + diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master index a376f68d8270f9b1c6bf6076c0471fd5ef7d0a8d..7d57e00517066e7935895c7cdb127df5b78ec77e 100644 --- a/install/tpl/apache_ispconfig.conf.master +++ b/install/tpl/apache_ispconfig.conf.master @@ -132,19 +132,6 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge -<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> - <tmpl_if name='apache_version' op='>' value='2.2' format='version'> - Require all granted - <tmpl_else> - Order allow,deny - Allow from all - </tmpl_if> - <IfModule mpm_itk_module> - AssignUserId ispconfig ispconfig - </IfModule> -</Directory> - NameVirtualHost *:80 NameVirtualHost *:443 <tmpl_loop name="ip_adresses"> diff --git a/interface/web/dashboard/dashlets/databasequota.php b/interface/web/dashboard/dashlets/databasequota.php index 8c5c360c23233306eec121c35445e7232a7762f1..ad2439e398ed2ddc7a4d3ff0d1ab91330f8c7d1d 100644 --- a/interface/web/dashboard/dashlets/databasequota.php +++ b/interface/web/dashboard/dashlets/databasequota.php @@ -11,7 +11,7 @@ class dashlet_databasequota { return; } - $modules = $_SESSION['s']['user']['modules']; + $modules = explode(',', $_SESSION['s']['user']['modules']); if (!in_array($modules, 'sites')) { return ''; } diff --git a/interface/web/dashboard/dashlets/quota.php b/interface/web/dashboard/dashlets/quota.php index 8179e4ead5f9ebbd7308149dce80f43c9d5f0c0a..443517b0bc3ee6618451fdf9a8c44d2064a57e59 100644 --- a/interface/web/dashboard/dashlets/quota.php +++ b/interface/web/dashboard/dashlets/quota.php @@ -11,7 +11,7 @@ class dashlet_quota { return; } - $modules = $_SESSION['s']['user']['modules']; + $modules = explode(',', $_SESSION['s']['user']['modules']); if (!in_array($modules, 'sites')) { return ''; } diff --git a/server/conf/apache_ispconfig.conf.master b/server/conf/apache_ispconfig.conf.master index e7058cd439a7672c47596c1d4e11571bbe11886e..831a18a0e1f4ed61ff316ceb7f0fcab89de8bcbc 100644 --- a/server/conf/apache_ispconfig.conf.master +++ b/server/conf/apache_ispconfig.conf.master @@ -127,19 +127,6 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge -<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge> - <tmpl_if name='apache_version' op='>' value='2.2' format='version'> - Require all granted - <tmpl_else> - Order allow,deny - Allow from all - </tmpl_if> - <IfModule mpm_itk_module> - AssignUserId ispconfig ispconfig - </IfModule> -</Directory> - NameVirtualHost *:80 NameVirtualHost *:443 <tmpl_loop name="ip_adresses"> diff --git a/server/lib/classes/cron.d/100-monitor_database_size.inc.php b/server/lib/classes/cron.d/100-monitor_database_size.inc.php index 97f12253717980eb1bdbdded76b211d2b7a64777..b5025ca4ca7db53515f5ab7c42cb008972ee1312 100644 --- a/server/lib/classes/cron.d/100-monitor_database_size.inc.php +++ b/server/lib/classes/cron.d/100-monitor_database_size.inc.php @@ -95,12 +95,12 @@ class cronjob_monitor_database_size extends cronjob { if(!is_numeric($quota)) continue; if($quota < 1 || $quota > $data[$i]['size']) { - print 'database ' . $rec['database_name'] . ' size does not exceed quota: ' . ($quota < 1 ? 'unlimited' : $quota) . ' (quota) > ' . $data[$i]['size'] . " (used)\n"; + //print 'database ' . $rec['database_name'] . ' size does not exceed quota: ' . ($quota < 1 ? 'unlimited' : $quota) . ' (quota) > ' . $data[$i]['size'] . " (used)\n"; if($rec['quota_exceeded'] == 'y') { $app->dbmaster->datalogUpdate('web_database', array('quota_exceeded' => 'n'), 'database_id', $rec['database_id']); } } elseif($rec['quota_exceeded'] == 'n') { - print 'database ' . $rec['database_name'] . ' size exceeds quota: ' . $quota . ' (quota) < ' . $data[$i]['size'] . " (used)\n"; + //print 'database ' . $rec['database_name'] . ' size exceeds quota: ' . $quota . ' (quota) < ' . $data[$i]['size'] . " (used)\n"; $app->dbmaster->datalogUpdate('web_database', array('quota_exceeded' => 'y'), 'database_id', $rec['database_id']); } } diff --git a/server/lib/classes/cron.d/100-monitor_hd_quota.inc.php b/server/lib/classes/cron.d/100-monitor_hd_quota.inc.php index a4971eb532df3a99c231c90d2e3952b334bed323..33c7e59589a0b053f9bb3317d103ed263fd25c07 100644 --- a/server/lib/classes/cron.d/100-monitor_hd_quota.inc.php +++ b/server/lib/classes/cron.d/100-monitor_hd_quota.inc.php @@ -112,13 +112,13 @@ class cronjob_monitor_hd_quota extends cronjob { $groupname = $s[0]; if (substr($groupname, 0, 6) == 'client') { if (isset($data['group'][$groupname])) { - $data['group'][$groupname]['used'] += $s[1]; - $data['group'][$groupname]['soft'] += $s[2]; - $data['group'][$groupname]['hard'] += $s[3]; + $data['group'][$groupname]['used'] += $s[2]; + $data['group'][$groupname]['soft'] += $s[3]; + $data['group'][$groupname]['hard'] += $s[4]; } else { - $data['group'][$groupname]['used'] = $s[1]; - $data['group'][$groupname]['soft'] = $s[2]; - $data['group'][$groupname]['hard'] = $s[3]; + $data['group'][$groupname]['used'] = $s[2]; + $data['group'][$groupname]['soft'] = $s[3]; + $data['group'][$groupname]['hard'] = $s[4]; } } } diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index b4a6d2e86500c915886f95a7a4580f86b82f56c0..432f5f107b98cb5872dc6437e4aa2423f930b401 100644 --- a/server/lib/classes/monitor_tools.inc.php +++ b/server/lib/classes/monitor_tools.inc.php @@ -561,13 +561,11 @@ class monitor_tools { } break; case 'log_letsencrypt': - if ($dist == 'debian') { - $logfile = '/var/log/letsencrypt/letsencrypt.log'; - } elseif ($dist == 'redhat') { - $logfile = '/var/log/letsencrypt/letsencrypt.log'; - } elseif ($dist == 'suse') { - $logfile = '/var/log/letsencrypt/letsencrypt.log'; - } elseif ($dist == 'gentoo') { + if(file_exists('/root/.acme.sh/acme.sh') && file_exists('/root/.acme.sh/acme.sh.log')) { + $logfile = '/root/.acme.sh/acme.sh.log'; + } elseif(file_exists('/usr/local/ispconfig/server/scripts/acme.sh') && file_exists('/usr/local/ispconfig/server/scripts/acme.sh.log')) { + $logfile = '/usr/local/ispconfig/server/scripts/acme.sh.log'; + } else { $logfile = '/var/log/letsencrypt/letsencrypt.log'; } break; diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 726efe5118a28ddf2138d7728c9bf86c4da22aeb..36fc55b0965b6fdbc9431722cbd668bbbac47c50 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -137,7 +137,7 @@ class mysql_clientdb_plugin { if($user_access_mode == 'r') $grants = 'SELECT'; elseif($user_access_mode == 'rd') $grants = 'SELECT, DELETE, ALTER, DROP'; - $database_name = str_replace('_', '\\_', $link->escape_string($database_name)); + $database_name = $link->escape_string($database_name); if($action == 'GRANT') { if($user_access_mode == 'r' || $user_access_mode == 'rd') {