Skip to content
class.ISPConfigDebianOS.inc.php 34.1 KiB
Newer Older
Marius Burkard's avatar
Marius Burkard committed
		$result = $this->exec($cmd);
		if($result === false) {
			throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
		if(ISPConfig::shallInstall('web')) {
			ISPConfigLog::info('Adding php versions to ISPConfig.', true);

			$server_id = 0;
			$ispc_config = ISPConfigConnector::getLocalConfig();
			if(!$ispc_config || !isset($ispc_config['server_id']) || !$ispc_config['server_id']) {
				throw new ISPConfigOSException('Could not read ISPConfig settings file.');
			}
			$server_id = $ispc_config['server_id'];

			foreach($php_versions as $curver) {
				$qry = 'INSERT IGNORE INTO `dbispconfig`.`server_php` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `client_id`, `name`, `php_fastcgi_binary`, `php_fastcgi_ini_dir`, `php_fpm_init_script`, `php_fpm_ini_dir`, `php_fpm_pool_dir`, `active`) VALUES (1, 1, \'riud\', \'riud\', \'\', ' . intval($server_id) . ', 0, \'PHP ' . $curver . '\', \'/usr/bin/php-cgi' . $curver . '\', \'/etc/php/' . $curver . '/cgi/php.ini\', \'/etc/init.d/php' . $curver . '-fpm\', \'/etc/php/' . $curver . '/fpm/php.ini\', \'/etc/php/' . $curver . '/fpm/pool.d\', \'y\')';			  $cmd = 'mysql --defaults-file=/etc/mysql/debian.cnf -e ' . escapeshellarg($qry);
				$result = $this->exec($cmd);
				if($result === false) {
					throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
				}
			}
		}
		
		$this->restartService('clamav-daemon');
		
Marius Burkard's avatar
Marius Burkard committed
		ISPConfigLog::info('Checking all services are running.', true);
		$check_services = array(
			'mysql',
			'clamav-daemon',
			'postfix',
			'bind9',
		);
		if(ISPConfig::shallInstall('web')) {
			$check_services[] = 'pureftpd';
			$check_services[] = 'apache2';
		}
		if(ISPConfig::shallInstall('mail')) {
			$check_services[] = 'rspamd';
			$check_services[] = 'redis-server';
			$check_services[] = 'dovecot';
		}
		
Marius Burkard's avatar
Marius Burkard committed
		foreach($check_services as $service) {
			$status = $this->isServiceRunning($service);
			ISPConfigLog::info($service . ' :' . ($status ? 'OK' : 'FAILED'), true);
			if(!$status) {
				ISPConfigLog::warn($service . ' seems not to be running!', true);
			}
		}
			
		
		ISPConfigLog::info('Installation ready.', true);
		
		if(ISPConfig::shallInstall('mailman')) {
			ISPConfigLog::info('Your Mailman password is: ' . $mailman_password, true);
		}
		if(ISPConfig::shallInstall('web')) {
			ISPConfigLog::info('Your ISPConfig admin password is: ' . $ispconfig_admin_pw, true);
		}
Marius Burkard's avatar
Marius Burkard committed
		ISPConfigLog::info('Your MySQL root password is: ' . $mysql_root_pw, true);