| | |
| | | require_once('lib/installer_base.lib.php'); |
| | | |
| | | //** Get distribution identifier |
| | | $distname = get_distname(); |
| | | $dist = get_distname(); |
| | | |
| | | if($distname == '') die('Linux Dustribution or Version not recognized.'); |
| | | if($dist['id'] == '') die('Linux Dustribution or Version not recognized.'); |
| | | |
| | | //** Include the distribution specific installer class library and configuration |
| | | include_once('dist/lib/'.$distname.'.lib.php'); |
| | | include_once('dist/conf/'.$distname.'.conf.php'); |
| | | if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); |
| | | include_once('dist/lib/'.$dist['id'].'.lib.php'); |
| | | include_once('dist/conf/'.$dist['id'].'.conf.php'); |
| | | |
| | | //** Install logfile |
| | | define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); |
| | |
| | | //** Get the hostname |
| | | $tmp_out = array(); |
| | | exec('hostname -f', $tmp_out); |
| | | $inst->conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg foo.example.com ', $tmp_out[0]); |
| | | $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg foo.example.com ', $tmp_out[0]); |
| | | unset($tmp_out); |
| | | |
| | | //** Get MySQL root credentials |
| | |
| | | } |
| | | } while ($finished == false); |
| | | unset($finished); |
| | | |
| | | // Resolve the IP address of the mysql hostname. |
| | | if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); |
| | | |
| | | |
| | | //** initializing database connection |
| | | include_once('lib/mysql.lib.php'); |
| | |
| | | //* Configure Apache |
| | | swriteln('Configuring Apache'); |
| | | $inst->configure_apache(); |
| | | |
| | | //* Configure Firewall |
| | | swriteln('Configuring Firewall'); |
| | | $inst->configure_firewall(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing ISPConfig'); |
| | | |
| | | //** Customise the port ISPConfig runs on |
| | | $inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); |
| | | $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); |
| | | |
| | | $inst->install_ispconfig(); |
| | | |
| | | //* Configure DBServer |
| | | swriteln('Configuring DBServer'); |
| | | $inst->configure_dbserver(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing Crontab'); |
| | |
| | | system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | | system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); |
| | | system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart'); |
| | | system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); |
| | | |
| | | }else{ |
| | | |
| | |
| | | // $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1'); |
| | | // Server ID is an autoInc value of the mysql database now |
| | | |
| | | if(strtolower($inst->simple_query('Shall this server join a existing ISPConfig installation? If not, we will create a new database now',array('y','n'),'y')) == 'n') { |
| | | if(strtolower($inst->simple_query('Create a new database? (We do not want to join a existing ISPConfig server setup)',array('y','n'),'y')) == 'y') { |
| | | //* Create the mysql database |
| | | $inst->configure_database(); |
| | | system('/etc/init.d/mysql restart'); |
| | | //system('/etc/init.d/mysql restart'); |
| | | } |
| | | |
| | | //* Insert the Server record into the database |
| | | swriteln('Adding ISPConfig server record to database.'); |
| | | swriteln(''); |
| | | $inst->add_database_server_record(); |
| | | |
| | | |
| | |
| | | $inst->configure_apache(); |
| | | } |
| | | |
| | | //** Configure Firewall |
| | | if(strtolower($inst->simple_query('Configure Firewall Server',array('y','n'),'y')) == 'y') { |
| | | swriteln('Configuring Firewall'); |
| | | $inst->configure_firewall(); |
| | | } |
| | | |
| | | //** Configure ISPConfig :-) |
| | | if(strtolower($inst->simple_query('Install ISPConfig',array('y','n'),'y')) == 'y') { |
| | | if(strtolower($inst->simple_query('Install ISPConfig Web-Interface',array('y','n'),'y')) == 'y') { |
| | | swriteln('Installing ISPConfig'); |
| | | |
| | | //** We want to check if the server is a module or cgi based php enabled server |
| | | //** TODO: Don't always ask for this somehow ? |
| | | //** TODO: Don't always ask for this somehow ? |
| | | /* |
| | | $fast_cgi = $inst->simple_query('CGI PHP Enabled Server?', array('yes','no'),'no'); |
| | | |
| | | if($fast_cgi == 'yes') { |
| | | $alias = $inst->free_query('Script Alias', '/php/'); |
| | | $path = $inst->free_query('Script Alias Path', '/path/to/cgi/bin'); |
| | | $inst->conf['apache']['vhost_cgi_alias'] = sprintf('ScriptAlias %s %s', $alias, $path); |
| | | $conf['apache']['vhost_cgi_alias'] = sprintf('ScriptAlias %s %s', $alias, $path); |
| | | } else { |
| | | $inst->conf['apache']['vhost_cgi_alias'] = ""; |
| | | $conf['apache']['vhost_cgi_alias'] = ""; |
| | | } |
| | | */ |
| | | |
| | | //** Customise the port ISPConfig runs on |
| | | $inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); |
| | | $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); |
| | | |
| | | |
| | | $inst->install_ispconfig(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing Crontab'); |
| | | $inst->install_crontab(); |
| | | system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | | $inst->install_ispconfig_interface = true; |
| | | |
| | | } else { |
| | | $inst->install_ispconfig_interface = false; |
| | | } |
| | | |
| | | $inst->install_ispconfig(); |
| | | |
| | | //* Configure DBServer |
| | | swriteln('Configuring DBServer'); |
| | | $inst->configure_dbserver(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing Crontab'); |
| | | $inst->install_crontab(); |
| | | system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | | |
| | | |
| | | |
| | | } //* << $install_mode / 'Standard' or Genius |
| | | |
| | | |