diff --git a/README.md b/README.md index 7bb7e4bd21c825b1da694c9324ec668005818e67..a8681a6c9e0c837ddeea5c516e83a9a248b71e7a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ ![alt text](https://www.ispconfig.org/wp-content/themes/ispconfig/images/ispconfig_logo.png "") \ [![pipeline status](https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller/badges/master/pipeline.svg)](https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller/commits/master) -This script configures your server (Ubuntu 18.04, Ubuntu 20.04, Debian 9, 10 and 11 currently) following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. +This script configures your server following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. + +## Supported distributions +- Ubuntu 22.04 and 24.04. +- Debian 11 and 12. + +A list of all supported distributions by ISPConfig itself can be found at https://www.ispconfig.org/. ## Using the script You can use the script with curl diff --git a/ispc3-ai.sh b/ispc3-ai.sh index aa240ecfd7a5897c88654bc7fc7b6205ec4c8980..092fe14f695afb0fab208532c5eb922bd8e19c24 100755 --- a/ispc3-ai.sh +++ b/ispc3-ai.sh @@ -34,7 +34,7 @@ fi if [ "$PHP" = "" ] ; then echo "PHP cli missing, trying to install." ; - apt-get update -qq && apt-get -y -qq install php-cli && apt-get -y -qq install php-mbstring ; + apt-get update -qq && apt-get -y -qq install dialog && apt-get -y -qq install php-cli && apt-get -y -qq install php-mbstring ; PHP=$(which php) ; fi if [ "$PHP" = "" ] ; then diff --git a/lib/os/class.ISPConfigBaseOS.inc.php b/lib/os/class.ISPConfigBaseOS.inc.php index b3a48279e19ac7bcff787a1e3a75865268acefba..c66eb5f63c873fe01f4737ff6e2899f2d41322e9 100644 --- a/lib/os/class.ISPConfigBaseOS.inc.php +++ b/lib/os/class.ISPConfigBaseOS.inc.php @@ -34,11 +34,17 @@ class ISPConfigBaseOS { throw new ISPConfigOSException('Could not detect version of distribution ' . $os['ID']); } if($os['ID'] === 'debian') { - if(!in_array($os['VERSION_ID'], array('9', '10', '11', '12'))) { + if(in_array($os['VERSION_ID'], array('9', '10'))) { + throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported anymore for ' . $os['ID']); + } + if(!in_array($os['VERSION_ID'], array('11', '12'))) { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } elseif($os['ID'] === 'ubuntu') { - if(!in_array($os['VERSION_ID'], array('18.04', '20.04', '22.04'))) { + if(in_array($os['VERSION_ID'], array('18.04', '20.04'))) { + throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported anymore for ' . $os['ID']); + } + if(!in_array($os['VERSION_ID'], array('22.04', '24.04'))) { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } else { diff --git a/lib/os/class.ISPConfigDebianOS.inc.php b/lib/os/class.ISPConfigDebianOS.inc.php index d35f371c346367de7de2bd9ac3dda2ca0d43959e..d289fac09510286d2ad5d41db5e310e94a361799 100644 --- a/lib/os/class.ISPConfigDebianOS.inc.php +++ b/lib/os/class.ISPConfigDebianOS.inc.php @@ -493,6 +493,15 @@ Alias /phpmyadmin /usr/share/phpmyadmin } } + protected function addRspamdRepo() { + ISPConfigLog::info('Activating rspamd repository.', true); + $cmd = 'mkdir -p /etc/apt/keyrings ; wget -q -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/rspamd.gpg > /dev/null ; echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/rspamd.list ; echo "deb-src [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/rspamd.list'; + $result = $this->exec($cmd); + if($result === false) { + throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); + } + } + protected function installMonit() { ISPConfigLog::info('Installing Monit', true); @@ -1405,12 +1414,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; $this->installPackages($packages); if(ISPConfig::shallInstall('mail') && !ISPConfig::wantsAmavis()) { - ISPConfigLog::info('Activating rspamd repository.', true); - $cmd = 'mkdir -p /etc/apt/keyrings ; wget -q -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/rspamd.gpg > /dev/null ; echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/rspamd.list ; echo "deb-src [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/rspamd.list'; - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } + $this->addRspamdRepo(); } if(ISPConfig::wantsPHP() !== 'system') { @@ -1704,7 +1708,7 @@ SCRIPTWHITELIST=/usr/bin/lwp-request'; $result = $this->exec($cmd); if($result === false) { throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } elseif(strpos($result, '127.0.0.1') === false) { + } elseif(strpos($result, '127.0.0.1') === false && strpos($result, '127.0.0.53') === false) { ISPConfigLog::warn('Unexpected resolver response: ' . $result, true); } } else { diff --git a/lib/os/class.ISPConfigUbuntu2204OS.inc.php b/lib/os/class.ISPConfigUbuntu2204OS.inc.php index cb292bc74ca7d60511e555be0d6984384c8cea5f..5f2abe957857d577fb427502c5414e6a65b9d35a 100644 --- a/lib/os/class.ISPConfigUbuntu2204OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2204OS.inc.php @@ -39,28 +39,6 @@ deb http://security.ubuntu.com/ubuntu jammy-security multiverse return $packages; } - protected function setDefaultPHP() { - ISPConfigLog::info('Setting default system PHP version.', true); - $cmd = 'update-alternatives --set php /usr/bin/php8.1'; - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } - - if(ISPConfig::shallInstall('web')) { - // When --use-php-system is used, there is no alternative for php-fpm.sock. - if(ISPConfig::wantsPHP() === 'system') { - $cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi8.1'; - } else { - $cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi8.1 ; update-alternatives --set php-fpm.sock /run/php/php8.1-fpm.sock'; - } - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } - } - } - protected function getMySQLUserQueries($mysql_root_pw) { $escaped_pw = preg_replace('/[\'\\\\]/', '\\$1', $mysql_root_pw); $queries = array( @@ -76,7 +54,7 @@ deb http://security.ubuntu.com/ubuntu jammy-security multiverse } protected function installMailman($host_name) { - ISPConfigLog::info('ISPConfig does not yet support mailman3 and mailman2 is no longer available in Ubuntu 22.04.', true); + ISPConfigLog::info('ISPConfig does not yet support mailman3 and mailman2 is no longer available since Ubuntu 22.04.', true); return; } diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..c99816fb4f775a307fee1768895315abc4d6ff3d --- /dev/null +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -0,0 +1,52 @@ +replaceLine('/etc/roundcube/config.inc.php', "\$config['smtp_host']", "\$config['smtp_host'] = 'localhost:25';"); + } + +}