Skip to content
Commits on Source (9)
......@@ -10,6 +10,11 @@ WGET=$(which wget) ;
PHP=$(which php) ;
APT=$(which apt-get) ;
use_git=false;
if [ -d .git ]; then
use_git=true;
fi
if [ "$APT" = "" ] ; then
echo "It seems you are using a distribution that has no apt-get available. This is not supported.";
exit 1 ;
......@@ -37,29 +42,34 @@ if [ "$PHP" = "" ] ; then
exit 1;
fi
if [ "$CURL" != "" ] ; then
$CURL -s -o /tmp/ispconfig-ai.tar.gz "https://www.ispconfig.org/downloads/ispconfig-ai.tar.gz" >/dev/null 2>&1
else
$WGET -q -O /tmp/ispconfig-ai.tar.gz "https://www.ispconfig.org/downloads/ispconfig-ai.tar.gz" >/dev/null 2>&1
fi
INSTALL_DIR=".";
if [ "$use_git" = false ] ; then
if [ ! -f "/tmp/ispconfig-ai.tar.gz" ] ; then
echo "Failed downloading Autoinstaller" ;
exit 1;
fi
if [ "$CURL" != "" ] ; then
$CURL -s -o /tmp/ispconfig-ai.tar.gz "https://www.ispconfig.org/downloads/ispconfig-ai.tar.gz" >/dev/null 2>&1
else
$WGET -q -O /tmp/ispconfig-ai.tar.gz "https://www.ispconfig.org/downloads/ispconfig-ai.tar.gz" >/dev/null 2>&1
fi
if [ ! -f "/tmp/ispconfig-ai.tar.gz" ] ; then
echo "Failed downloading Autoinstaller" ;
exit 1;
fi
rm -rf /tmp/ispconfig-ai ;
mkdir /tmp/ispconfig-ai ;
tar -C /tmp/ispconfig-ai/ -xzf /tmp/ispconfig-ai.tar.gz || (echo "Failed extracting Autoinstaller" ; exit 1)
rm -f /tmp/ispconfig-ai.tar.gz ;
cd /tmp/ispconfig-ai ;
rm -rf /tmp/ispconfig-ai ;
mkdir /tmp/ispconfig-ai ;
tar -C /tmp/ispconfig-ai/ -xzf /tmp/ispconfig-ai.tar.gz || (echo "Failed extracting Autoinstaller" ; exit 1)
rm -f /tmp/ispconfig-ai.tar.gz ;
cd /tmp/ispconfig-ai ;
INSTALL_DIR="/tmp/ispconfig-ai";
fi
TTY=$(ps ax | grep "^[ ]*"$$ | head -n 1 | awk '{ print $2 }' 2>/dev/null);
if [ "$TTY" != "" ] ; then
${PHP} -q /tmp/ispconfig-ai/ispconfig.ai.php $@ < /dev/${TTY} ;
${PHP} -q "$INSTALL_DIR/ispconfig.ai.php" $@ < /dev/${TTY} ;
else
echo "It seems you are not using a TTY. Please add --i-know-what-i-am-doing to the arguments.";
${PHP} -q /tmp/ispconfig-ai/ispconfig.ai.php $@ ;
${PHP} -q "$INSTALL_DIR/ispconfig.ai.php" $@ ;
fi
cd ${CURDIR} ;
......@@ -157,8 +157,18 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
return $packages;
}
protected function getApacheModulesToDisable() {
$modules = array(
'mpm_prefork'
);
if(ISPConfig::wantsPHP() !== 'system') {
array_unshift($modules, 'php8.0');
}
return $modules;
}
protected function getApacheModulesToEnable() {
$modules = array('suexec', 'rewrite', 'ssl', 'actions', 'include', 'dav_fs', 'dav', 'auth_digest', 'cgi', 'headers', 'proxy_fcgi', 'alias');
$modules = array('suexec', 'rewrite', 'ssl', 'actions', 'include', 'dav_fs', 'dav', 'auth_digest', 'cgi', 'headers', 'proxy_fcgi', 'alias', 'http2', 'mpm_event');
return $modules;
}
......@@ -774,7 +784,6 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
'apache2-utils',
'libapache2-mod-fcgid',
'apache2-suexec-pristine',
'libapache2-mod-php',
'libapache2-mod-python',
'libapache2-mod-passenger'
);
......@@ -799,6 +808,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
if(ISPConfig::wantsPHP() === 'system') {
$php_versions = array($this->getSystemPHPVersion());
} else {
// If a new version is added, the getApacheModulesToDisable function should be updated to disable the latest version (this part could be improved)
$php_versions = array(
'5.6',
'7.0',
......@@ -852,6 +862,15 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$this->installPackages($packages);
if(ISPConfig::shallInstall('web') && ISPConfig::$WEBSERVER === ISPC_WEBSERVER_APACHE) {
// Disable conflicting modules so mpm_event can be used with http2
ISPConfigLog::info('Disabling conflicting apache modules.', true);
$modules = $this->getApacheModulesToDisable();
$cmd = 'a2dismod ' . implode(' ', $modules) . ' 2>&1';
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
ISPConfigLog::info('Enabling apache modules.', true);
$modules = $this->getApacheModulesToEnable();
$cmd = 'a2enmod ' . implode(' ', $modules) . ' 2>&1';
......@@ -859,6 +878,16 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
ISPConfigLog::info('Enabling default PHP-FPM config.', true);
$conf = 'php' . $this->getSystemPHPVersion() . '-fpm';
$cmd = 'a2enconf ' . $conf . ' 2>&1';
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
$this->restartService('apache2');
}
try {
......@@ -1078,6 +1107,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$replacements = array(
'/^\s*\$config\s*\[["\']default_host["\']\]\s*=.*$/m' => '$config[\'default_host\'] = \'localhost\';',
'/^\s*\$config\s*\[["\']smtp_server["\']\]\s*=.*$/m' => '$config[\'smtp_server\'] = \'%h\';',
'/^\s*\$config\s*\[["\']smtp_port["\']\]\s*=.*$/m' => '$config[\'smtp_port\'] = 25;',
'/^\s*\$config\s*\[["\']smtp_user["\']\]\s*=.*$/m' => '$config[\'smtp_user\'] = \'%u\';',
'/^\s*\$config\s*\[["\']smtp_pass["\']\]\s*=.*$/m' => '$config[\'smtp_pass\'] = \'%p\';'
);
......