diff --git a/lib/os/class.ISPConfigDebianOS.inc.php b/lib/os/class.ISPConfigDebianOS.inc.php index fe32aa94e323ce68ec85dfe9ffe47ea62eb0e83f..d4dc787070e8e9f89af3ff204e86cc88abe227ac 100644 --- a/lib/os/class.ISPConfigDebianOS.inc.php +++ b/lib/os/class.ISPConfigDebianOS.inc.php @@ -163,7 +163,7 @@ class ISPConfigDebianOS extends ISPConfigBaseOS { $modules = array( 'mpm_prefork' ); - + return $modules; } @@ -442,6 +442,35 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; return false; } + ISPConfigLog::info('Checking hostname.', true); + + $host_name = false; + $cmd = 'hostname -f 2>&1'; + $check = $this->exec($cmd); + if($check === false) { + throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); + } else { + $host_name = $check; + }/* elseif(trim($check) !== $host_name) { + ISPConfigLog::warn('Hostname mismatch: ' . $check . ' != ' . $host_name); + }*/ + + $cmd = 'hostname 2>&1'; + $check = $this->exec($cmd); + if($check === false) { + throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); + }/* elseif(trim($check) !== $short_hostname) { + ISPConfigLog::warn('Short hostname mismatch: ' . $check . ' != ' . $short_hostname); + }*/ + + if($host_name == '') { + ISPConfigLog::error('Could not read the host name of your server. Please check it is correctly set.', true); + throw new ISPConfigOSException('Invalid host name or host name not found.'); + } elseif(substr_count($host_name, '.') < 2) { + ISPConfigLog::error('The host name ' . $host_name . ' of your server is no fully qualified domain name (xyz.domain.com). Please check it is correctly set.', true); + throw new ISPConfigOSException('Host name is no FQDN.'); + } + $this->configureApt(); $this->updatePackageList(); @@ -558,34 +587,6 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; ISPConfigLog::info('Server online again.', true); }*/ - ISPConfigLog::info('Checking hostname.', true); - - $host_name = false; - $cmd = 'hostname -f 2>&1'; - $check = $this->exec($cmd); - if($check === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } else { - $host_name = $check; - }/* elseif(trim($check) !== $host_name) { - ISPConfigLog::warn('Hostname mismatch: ' . $check . ' != ' . $host_name); - }*/ - - $cmd = 'hostname 2>&1'; - $check = $this->exec($cmd); - if($check === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - }/* elseif(trim($check) !== $short_hostname) { - ISPConfigLog::warn('Short hostname mismatch: ' . $check . ' != ' . $short_hostname); - }*/ - - if($host_name == '') { - ISPConfigLog::error('Could not read the host name of your server. Please check it is correctly set.', true); - throw new ISPConfigOSException('Invalid host name or host name not found.'); - } elseif(substr_count($host_name, '.') < 2) { - ISPConfigLog::error('The host name ' . $host_name . ' of your server is no fully qualified domain name (xyz.domain.com). Please check it is correctly set.', true); - throw new ISPConfigOSException('Host name is no FQDN.'); - } $cmd = 'readlink /bin/sh 2>&1'; $check = trim($this->exec($cmd));