| | |
| | | |
| | | error_reporting(E_ALL|E_STRICT); |
| | | |
| | | define('INSTALLER_RUN', true); |
| | | |
| | | //** The banner on the command line |
| | | echo "\n\n".str_repeat('-',80)."\n"; |
| | | echo " _____ ___________ _____ __ _ ____ |
| | |
| | | //** Detect the installed applications |
| | | $inst->find_installed_apps(); |
| | | |
| | | //** Select the language |
| | | //** Select the language and set default timezone |
| | | $conf['language'] = $inst->simple_query('Select language', array('en','de'), 'en'); |
| | | $conf['timezone'] = get_system_timezone(); |
| | | |
| | | //* Set default theme |
| | | $conf['theme'] = 'default'; |
| | | $conf['language_file_import_enabled'] = true; |
| | | |
| | | //** Select installation mode |
| | | $install_mode = $inst->simple_query('Installation mode', array('standard','expert'), 'standard'); |
| | |
| | | //** Get the hostname |
| | | $tmp_out = array(); |
| | | exec('hostname -f', $tmp_out); |
| | | $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $tmp_out[0]); |
| | | $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0]); |
| | | unset($tmp_out); |
| | | |
| | | // Check if the mysql functions are loaded in PHP |
| | |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database']); |
| | | $tmp_mysql_server_charset = $inst->free_query('MySQL charset', $conf['mysql']['charset']); |
| | | |
| | | if($install_mode == 'expert') { |
| | | swriteln("The next two questions are about the internal ISPConfig database user and password.\nIt is recommended to accept the defaults which are 'ispconfig' as username and a random password.\nIf you use a different password, use only numbers and chars for the password.\n"); |
| | | $conf['mysql']['ispconfig_user'] = $inst->free_query('ISPConfig mysql database username', $conf['mysql']['ispconfig_user']); |
| | | $conf['mysql']['ispconfig_password'] = $inst->free_query('ISPConfig mysql database password', $conf['mysql']['ispconfig_password']); |
| | | } |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | |
| | | $inst->configure_apps_vhost(); |
| | | |
| | | //* Configure Firewall |
| | | //** Configure Firewall |
| | | if($conf['ufw']['installed'] == true) { |
| | | //* Configure UFW Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring UFW Firewall'); |
| | | $inst->configure_ufw_firewall(); |
| | | } else { |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_firewall(); |
| | | } |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_firewall(); |
| | | |
| | | //* Configure Fail2ban |
| | | if($conf['fail2ban']['installed'] == true) { |
| | |
| | | swriteln('Installing ISPConfig'); |
| | | |
| | | //** Customize the port ISPConfig runs on |
| | | $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); |
| | | $ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080'); |
| | | if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port; |
| | | if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port; |
| | | unset($ispconfig_vhost_port); |
| | | |
| | | if(strtolower($inst->simple_query('Do you want a secure (SSL) connection to the ISPConfig web interface',array('y','n'),'y')) == 'y') { |
| | | $inst->make_ispconfig_ssl_cert(); |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart >/dev/null 2>&1 &'); |
| | | if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | | //* Reload is enough for nginx |
| | | if($conf['nginx']['installed'] == true){ |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart >/dev/null 2>&1 &'); |
| | | } |
| | | |
| | | //** Configure Jailkit |
| | |
| | | |
| | | //** Configure Firewall |
| | | if(strtolower($inst->simple_query('Configure Firewall Server',array('y','n'),'y')) == 'y') { |
| | | if($conf['bastille']['installed'] == true) { |
| | | //if($conf['bastille']['installed'] == true) { |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_firewall(); |
| | | } elseif($conf['ufw']['installed'] == true) { |
| | | /*} elseif($conf['ufw']['installed'] == true) { |
| | | //* Configure Ubuntu Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring Ubuntu Firewall'); |
| | | $inst->configure_ufw_firewall(); |
| | | } |
| | | */ |
| | | } |
| | | |
| | | //** Configure Firewall |
| | |
| | | }*/ |
| | | |
| | | //** Configure ISPConfig :-) |
| | | if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),'y')) == 'y') { |
| | | $install_ispconfig_interface_default = ($conf['mysql']['master_slave_setup'] == 'y')?'n':'y'; |
| | | if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),$install_ispconfig_interface_default)) == 'y') { |
| | | swriteln('Installing ISPConfig'); |
| | | |
| | | //** We want to check if the server is a module or cgi based php enabled server |