Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ispconfig/ispconfig-autoinstaller
  • ahrasis/ispconfig-autoinstaller
  • eurodomenii/ispconfig-autoinstaller
  • thom/ispconfig-autoinstaller
  • Samgarr/ispconfig-autoinstaller
  • Chris_UK/ispconfig-autoinstaller
  • SpartakusMd/ispconfig-autoinstaller
  • Nardol/ispconfig-autoinstaller
  • hairy/ispconfig-autoinstaller
  • hebbet/ispconfig-autoinstaller
  • gOOvER/ispconfig-autoinstaller
11 results
Show changes
Commits on Source (70)
Showing with 720 additions and 297 deletions
......@@ -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
......
......@@ -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
......
......@@ -12,7 +12,7 @@ try {
ISPConfigLog::setLogPriority(ISPConfigLog::PRIO_INFO);
ISPConfig::run();
} catch(Exception $e) {
ISPConfigLog::error('Exception occured: ' . get_class($e) . ' -> ' . $e->getMessage(), true);
ISPConfigLog::error('Exception occurred: ' . get_class($e) . ' -> ' . $e->getMessage(), true);
//var_dump($e);
exit;
}
\ No newline at end of file
......@@ -144,6 +144,8 @@ class ISPConfig {
public static function shallInstall($what) {
if(isset($_GET['no-'.$what]) && $_GET['no-'.$what]) {
return false;
} elseif(($what == 'jailkit' || $what == 'ftp') && isset($_GET['no-web']) && $_GET['no-web']) {
return false;
} else {
return true;
}
......@@ -191,7 +193,9 @@ class ISPConfig {
'7.3',
'7.4',
'8.0',
'8.1'
'8.1',
'8.2',
'8.3'
);
if(isset($_GET['use-php']) && $_GET['use-php']) {
if ($_GET['use-php'] === 'system') {
......@@ -321,45 +325,50 @@ Usage: ispc3-ai.sh [<argument>] [...]
This script automatically installs all needed packages for an ISPConfig 3 setup using the guidelines from the "Perfect Server Setup" howtos on www.howtoforge.com.
Possible arguments are:
--help ->Show this help page
--debug ->Enable verbose logging (logs each command with the exit code)
--channel ->Choose the channel to use for ISPConfig. --channel=<stable|dev>
--help ->Show this help page.
--debug ->Enable verbose logging (logs each command with the exit code).
--channel ->Choose the channel to use for ISPConfig: --channel=<stable|dev>
->"stable" is the latest ISPConfig release available on www.ispconfig.org
->"dev" is the latest dev-branch from the ISPConfig git repository: https://git.ispconfig.org/ispconfig/ispconfig3/tree/develop
-> The dev channel might contain bugs and less-tested features and should only be used in production by very experienced users.
->The dev channel might contain bugs and less-tested features and should only be used in production by very experienced users.
--lang ->Use language for ISPConfig installation. Specify with --lang=en|de (only en (English) and de (German) supported currently).
--interactive ->Don\'t install ISPConfig in non-interactive mode. This is needed if you want to use expert mode, e. g. to install a slave server that shall be integrated into an existing multiserver setup.
--use-nginx ->Use nginx webserver instead of apache2
--use-amavis ->Use amavis instead of rspamd for mail filtering
--interactive ->Don\'t install ISPConfig in non-interactive mode.
->This is needed if you want to use expert mode, e.g. to install a slave server that shall be integrated into an existing multiserver setup.
--use-nginx ->Use NGINX webserver instead of Apache2.
--use-amavis ->Use Amavis instead of Rspamd for mail filtering.
--use-unbound ->Use unbound instead of bind9 for local resolving. Only allowed if --no-dns is set.
--use-php ->Use specific PHP versions, comma separated, instead of installing multiple PHP, e.g. --use-php=7.4,8.0 (5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 available).
--use-php ->Use specific PHP versions, comma separated, instead of installing multiple PHP, e.g. --use-php=7.4,8.0 (5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 and 8.3 available).
->--use-php=system disables the sury repository and just installs the system\'s default PHP version.
->ommiting the argument (use all versions)
--use-ftp-ports ->This option sets the passive port range for pure-ftpd. You have to specify the port range separated by hyphen, e. g. --use-ftp-ports=40110-40210.
->--use-php while omitting the argument, uses all versions.
--use-ftp-ports ->This option sets the passive port range for pure-ftpd. You have to specify the port range separated by hyphen, e.g. --use-ftp-ports=40110-40210.
->If not provided the passive port range will not be configured.
--use-certbot ->Use Certbot instead of acme.sh for issuing Let\'s Encrypt certificates. Not adviced unless you are migrating from a old server that uses Certbot.
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma
--no-mail ->Do not use ISPConfig on this server to manage mailserver settings. This will install postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail. It implies --no-mailman.
--use-certbot ->Use Certbot instead of acme.sh for issuing Let\'s Encrypt certificates. Not advised unless you are migrating from an old server that uses Certbot.
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd.
->This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma.
--no-mail ->Do not use ISPConfig on this server to manage mailserver settings.
->This will install Postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail. It implies --no-mailman.
--no-dns ->Do not use ISPConfig on this server to manage DNS entries. Bind will be installed for local DNS caching / resolving only.
--no-local-dns ->Do not install local DNS caching / resolving via bind.
--no-firewall ->Do not install ufw and tell ISPConfig to not manage firewall settings on this server.
--no-roundcube ->Do not install roundcube webmail.
--roundcube ->Install Roundcube even when --no-mail is used. Manual configuration of Roundcube config is needed.
--no-pma ->Do not install PHPMyAdmin on this server.
--no-pma ->Do not install phpMyAdmin on this server.
--no-mailman ->Do not install Mailman mailing list manager.
--no-quota ->Disable file system quota
--no-ntp ->Disable NTP setup
--no-quota ->Disable file system quota.
--no-ntp ->Disable NTP setup.
--no-jailkit ->Do not install jailkit.
--no-ftp ->Do not install Pure-FTPd server.
--monit ->Install Monit and set it up to monitor installed services. Supported services: Apache2, NGINX, MariaDB, pure-ftpd-mysql, php-fpm, ssh, named, Postfix, Dovecot, rspamd.
--monit-alert-email
->Set up alerts for Monit to be send to given e-mail address. e.g. --monit-alert-email=me@example.com
--ssh-port -> Configure the SSH server to listen on a non-default port. Port number must be between 1 and 65535 and can not be in use by other services. e.g. --ssh-port=64
->Set up alerts for Monit to be sent to given e-mail address. e.g. --monit-alert-email=me@example.com.
--ssh-port ->Configure the SSH server to listen on a non-default port. Port number must be between 1 and 65535 and can not be in use by other services. e.g. --ssh-port=64.
--ssh-permit-root
-> Configure the SSH server wether or not to allow root login. Available options: yes | without-password | no - e.g. --ssh-permit-root=without-password
->Configure the SSH server whether or not to allow root login: --ssh-permit-root=<yes|without-password|no>, e.g. --ssh-permit-root=without-password.
--ssh-password-authentication
-> Configure the SSH server wether or not to allow password authentication. Available options: yes | no - e.g. -ssh-password-authentication=no
--ssh-harden -> Configure the SSH server to have a stronger security config.
->Configure the SSH server whether or not to allow password authentication: --ssh-password-authentication=<yes|no>, e.g. -ssh-password-authentication=no.
--ssh-harden ->Configure the SSH server to have a stronger security config.
--unattended-upgrades
->Install UnattendedUpgrades. You can add extra arguments for automatic cleanup and automatic reboots when necessary with --unattended-upgrades=autoclean,reboot (or only one of them).
->Install UnattendedUpgrades. You can add extra arguments for automatic cleanup and automatic reboots when necessary: --unattended-upgrades=autoclean,reboot (or only one of them).
--i-know-what-i-am-doing
->Prevent the autoinstaller to ask for confirmation before continuing to reconfigure the server.
';
......@@ -382,7 +391,7 @@ Possible arguments are:
'unattended-upgrades', 'roundcube', 'monit', 'monit-alert-email',
'ssh-port', 'ssh-permit-root', 'ssh-password-authentication', 'ssh-harden',
'channel', 'lang',
'no-web', 'no-mail', 'no-dns', 'no-firewall', 'no-roundcube', 'no-pma', 'no-mailman', 'no-quota', 'no-ntp', 'no-local-dns',
'no-web', 'no-mail', 'no-dns', 'no-firewall', 'no-roundcube', 'no-pma', 'no-mailman', 'no-quota', 'no-ntp', 'no-local-dns', 'no-jailkit', 'no-ftp',
'i-know-what-i-am-doing'
);
......@@ -412,7 +421,7 @@ Possible arguments are:
}
if(!isset($_GET['i-know-what-i-am-doing']) || !$_GET['i-know-what-i-am-doing']) {
print PXBashColor::getString('<lightred>WARNING!</lightred> This script will reconfigure your complete server!') . "\n";
print PXBashColor::getString('<lightred>WARNING!</lightred> This script will reconfigure your entire server!') . "\n";
print 'It should be run on a freshly installed server and all current configuration that you have done will most likely be lost!' . "\n";
$ok = ISPConfig::ask('Type \'yes\' if you really want to continue');
if($ok !== 'yes') {
......
......@@ -150,7 +150,7 @@ class ISPConfigLog {
if(!$fp) {
throw new ISPConfigLogException('Could not open logfile ' . $log_file . '.');
}
if(!@fwrite($fp, strftime("%d.%m.%Y-%H:%M:%S", time()) . ' - ' . $caller['file'] . ':' . $caller['line'] . ': [' . self::PRIORITY_TEXT[$priority] . '] ' . PXBashColor::getCleanString($message) . "\n")) {
if(!@fwrite($fp, date('d.m.Y-H:i:s') . ' - ' . $caller['file'] . ':' . $caller['line'] . ': [' . self::PRIORITY_TEXT[$priority] . '] ' . PXBashColor::getCleanString($message) . "\n")) {
throw new ISPConfigLogException('Could not write to logfile ' . $log_file . '.');
}
fclose($fp);
......
......@@ -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'))) {
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'))) {
throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported anymore for ' . $os['ID']);
}
if(!in_array($os['VERSION_ID'], array('20.04', '22.04', '24.04'))) {
throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']);
}
} else {
......@@ -58,6 +64,22 @@ class ISPConfigBaseOS {
return self::$os_data;
}
/**
* getOSArchitecture
*
* @return string
*/
public static function getOSArchitecture() {
$out = [];
exec('dpkg --print-architecture',$out);
$arch = $out[0];
if($arch != 'amd64' && $arch != 'arm64') {
throw new ISPConfigOSException('OS architecture '.$arch.' is not a supported.');
} else {
return $arch;
}
}
/**
* @return ISPConfigBaseOS
......@@ -127,7 +149,7 @@ class ISPConfigBaseOS {
}
foreach($entries as $line) {
if($add_if_existing === true || !preg_match('/^' . preg_quote($line) . '$/m', $content)) {
if($add_if_existing === true || !preg_match('/^' . preg_quote($line, '/') . '$/m', $content)) {
$content .= "\n" . $line . "\n";
}
}
......@@ -224,7 +246,7 @@ class ISPConfigBaseOS {
unset($new_lines);
unset($lines);
copy($file, $file . '~' . strftime('%Y%m%d%H%M%S', time()));
copy($file, $file . '~' . date('YmdHis'));
file_put_contents($file, $content);
return true;
}
......@@ -314,12 +336,76 @@ class ISPConfigBaseOS {
}
}
copy($file, $file . '~' . strftime('%Y%m%d%H%M%S', time()));
copy($file, $file . '~' . date('YmdHis'));
file_put_contents($file, $content);
return true;
}
protected function replaceLine($filename, $search_pattern, $new_line, $strict = false, $append = 1) {
$lines = @file($filename);
$out = '';
$found = 0;
if(is_array($lines)) {
foreach($lines as $line) {
if($strict === false && preg_match('/^REGEX:(.*)$/', $search_pattern)) {
if(preg_match(substr($search_pattern, 6), $line)) {
$out .= $new_line."\n";
$found = 1;
} else {
$out .= $line;
}
} elseif($strict === false) {
if(stristr($line, $search_pattern)) {
$out .= $new_line."\n";
$found = 1;
} else {
$out .= $line;
}
} else {
if(trim($line) == $search_pattern) {
$out .= $new_line."\n";
$found = 1;
} else {
$out .= $line;
}
}
}
}
if($found == 0) {
//* add \n if the last line does not end with \n or \r
if(substr($out, -1) != "\n" && substr($out, -1) != "\r" && filesize($filename) > 0) $out .= "\n";
//* add the new line at the end of the file
if($append == 1) {
$out .= $new_line."\n";
}
}
file_put_contents($filename, $out);
}
protected function removeLine($filename, $search_pattern, $strict = 0) {
if($lines = @file($filename)) {
$out = '';
foreach($lines as $line) {
if($strict == 0 && preg_match('/^REGEX:(.*)$/', $search_pattern)) {
if(!preg_match(substr($search_pattern, 6), $line)) {
$out .= $line;
}
} elseif($strict == 0) {
if(!stristr($line, $search_pattern)) {
$out .= $line;
}
} else {
if(!trim($line) == $search_pattern) {
$out .= $line;
}
}
}
file_put_contents($filename, $out);
}
}
protected function getInstallCommand($packages) {
if(is_string($packages)) {
$packages = array($packages);
......
......@@ -51,7 +51,7 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
}
protected function shallCompileJailkit() {
return true;
return ISPConfig::shallInstall('jailkit');
}
protected function getRoundcubePackages() {
......@@ -85,14 +85,18 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
}
protected function getFail2BanJail() {
$jk_jail = '[pure-ftpd]
$jk_jail = '';
if(ISPConfig::shallInstall('ftp')) {
$jk_jail .= '[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3
[dovecot]
';
}
$jk_jail .= '[dovecot]
enabled = true
filter = dovecot
logpath = /var/log/mail.log
......
......@@ -29,14 +29,22 @@ class ISPConfigDebian11OS extends ISPConfigDebian10OS {
if($key !== false) {
unset($packages[$key]);
}
$packages[] = 'jailkit';
} elseif($section === 'ftp_stats') {
if(ISPConfig::shallInstall('jailkit')) {
$packages[] = 'jailkit';
}
} elseif($section === 'stats') {
// prepare paths
ISPConfigLog::info('Symlinking webalizer to use awffull.');
mkdir('/etc/webalizer', 0755);
chmod('/etc/webalizer', 0755);
symlink('/etc/awffull/awffull.conf', '/etc/webalizer/webalizer.conf');
symlink('/usr/bin/awffull', '/usr/bin/webalizer');
if(!is_dir('/etc/webalizer')) {
mkdir('/etc/webalizer', 0755);
chmod('/etc/webalizer', 0755);
}
if(!is_link('/etc/webalizer/webalizer.conf') && !is_file('/etc/webalizer/webalizer.conf')) {
symlink('/etc/awffull/awffull.conf', '/etc/webalizer/webalizer.conf');
}
if(!is_link('/usr/bin/webalizer') && !is_file('/usr/bin/webalizer')) {
symlink('/usr/bin/awffull', '/usr/bin/webalizer');
}
$key = array_search('webalizer', $packages, true);
if($key !== false) {
......
<?php
require __DIR__ . '/class.ISPConfigDebian11OS.inc.php';
/**
* Description of class
*
* @author croydon
*/
class ISPConfigDebian12OS extends ISPConfigDebian11OS {
protected function addBusterBackportsRepo() {
// not in bullseye
}
protected function getRoundcubePackages() {
return array(
'roundcube',
'roundcube-core',
'roundcube-mysql',
'roundcube-plugins'
);
}
protected function getPackagesToInstall($section) {
$packages = parent::getPackagesToInstall($section);
if($section === 'first') {
$key = array_search('getmail', $packages, true);
if($key !== false) {
unset($packages[$key]);
}
$packages[] = 'getmail6';
$packages[] = 'rsyslog';
} elseif($section === 'mail') {
$key = array_search('rar', $packages, true);
if($key !== false) {
unset($packages[$key]);
}
}
return $packages;
}
protected function isStableSupported() {
return true;
}
protected function shallCompileJailkit() {
return false;
}
protected function getMySQLUserQueries($mysql_root_pw) {
$escaped_pw = preg_replace('/[\'\\\\]/', '\\$1', $mysql_root_pw);
$queries = array(
'DELETE FROM mysql.user WHERE User=\'\';',
'DELETE FROM mysql.user WHERE User=\'root\' AND Host NOT IN (\'localhost\', \'127.0.0.1\', \'::1\');',
'DROP DATABASE IF EXISTS test;',
'DELETE FROM mysql.db WHERE Db=\'test\' OR Db=\'test\\_%\';',
'SET PASSWORD FOR \'root\'@\'localhost\' = PASSWORD(\'' . $escaped_pw . '\');',
'FLUSH PRIVILEGES;'
);
return $queries;
}
protected function installMailman($host_name) {
ISPConfigLog::info('ISPConfig does not yet support mailman3 and mailman2 is no longer available in Debian 12.', true);
return;
}
protected function getSystemPHPVersion() {
return '8.2';
}
protected function installRoundcube($mysql_root_pw) {
parent::installRoundcube($mysql_root_pw);
$this->replaceLine('/etc/roundcube/config.inc.php', "\$config['smtp_host']", "\$config['smtp_host'] = 'localhost:25';");
}
}
This diff is collapsed.
......@@ -9,7 +9,21 @@ class ISPConfigUbuntu2004OS extends ISPConfigUbuntuOS {
// enable contrib and non-free
ISPConfigLog::info('Configuring apt repositories.', true);
$contents = '# created by ISPConfig auto installer
if($this->getOSArchitecture() == 'arm64') {
$contents = '# created by ISPConfig auto installer
deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security multiverse
';
} else {
$contents = '# created by ISPConfig auto installer
deb http://de.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://de.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://de.archive.ubuntu.com/ubuntu/ focal universe
......@@ -20,7 +34,8 @@ deb http://de.archive.ubuntu.com/ubuntu/ focal-backports main restricted univers
deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
';
';
}
file_put_contents('/etc/apt/sources.list', $contents);
}
......@@ -52,9 +67,11 @@ deb http://security.ubuntu.com/ubuntu focal-security multiverse
'imagemagick',
'libruby',
'memcached',
'php-apcu',
'jailkit'
'php-apcu'
);
if(ISPConfig::shallInstall('jailkit')) {
$packages[] = 'jailkit';
}
}
return $packages;
......@@ -75,14 +92,18 @@ deb http://security.ubuntu.com/ubuntu focal-security multiverse
}
protected function getFail2BanJail() {
$jk_jail = '[pure-ftpd]
$jk_jail = '';
if(ISPConfig::shallInstall('ftp')) {
$jk_jail .= '[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3
[dovecot]
';
}
$jk_jail .= '[dovecot]
enabled = true
filter = dovecot
action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]
......
......@@ -10,7 +10,21 @@ class ISPConfigUbuntu2204OS extends ISPConfigUbuntu2004OS {
// enable contrib and non-free
ISPConfigLog::info('Configuring apt repositories.', true);
$contents = '# created by ISPConfig auto installer
if($this->getOSArchitecture() == 'arm64') {
$contents = '# created by ISPConfig auto installer
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ jammy universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
';
} else {
$contents = '# created by ISPConfig auto installer
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ jammy universe
......@@ -21,7 +35,8 @@ deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe m
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
';
';
}
file_put_contents('/etc/apt/sources.list', $contents);
}
......@@ -39,28 +54,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 +69,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;
}
......
<?php
/**
* Description of class
*
* @author croydon
*/
class ISPConfigUbuntu2404OS extends ISPConfigUbuntu2204OS {
protected function configureApt() {
// enable contrib and non-free
ISPConfigLog::info('Configuring apt repositories.', true);
if($this->getOSArchitecture() == 'arm64') {
$contents = '# updated by ISPConfig auto installer
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
';
} else {
$contents = '# updated by ISPConfig auto installer
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
';
}
file_put_contents('/etc/apt/sources.list.d/ubuntu.sources', $contents);
}
protected function getPackagesToInstall($section) {
$packages = parent::getPackagesToInstall($section);
if($section === 'first') {
$packages[] = 'rsyslog';
}
return $packages;
}
protected function getSystemPHPVersion() {
return '8.3';
}
protected function addRspamdRepo() {
ISPConfigLog::info("Not activating Rspamd repository as it's not available for Ubuntu 24.04.", true);
}
protected function installRoundcube($mysql_root_pw) {
parent::installRoundcube($mysql_root_pw);
$this->replaceLine('/etc/roundcube/config.inc.php', "\$config['smtp_host']", "\$config['smtp_host'] = 'localhost:25';");
}
}
......@@ -60,14 +60,18 @@ deb http://security.ubuntu.com/ubuntu bionic-security multiverse
}
protected function getFail2BanJail() {
$jk_jail = '[pure-ftpd]
$jk_jail = '';
if(ISPConfig::shallInstall('ftp')) {
$jk_jail .= '[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3
[dovecot]
';
}
$jk_jail .= '[dovecot]
enabled = true
filter = dovecot
action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]
......