| | |
| | | //** Include the base class of the installer class |
| | | require_once('lib/installer_base.lib.php'); |
| | | |
| | | //** Ensure that current working directory is install directory |
| | | $cur_dir = getcwd(); |
| | | if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); |
| | | |
| | | //** Install logfile |
| | | define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); |
| | | define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); |
| | |
| | | $conf['mysql']['charset'] = 'utf8'; |
| | | $conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; |
| | | $conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; |
| | | $conf['language'] = $conf_old['language']; |
| | | if($conf['language'] == '{language}') $conf['language'] = 'en'; |
| | | |
| | | if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; |
| | | if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; |
| | | if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; |
| | | if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; |
| | | |
| | | //* Check if this is a master / slave setup |
| | | if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { |
| | | $conf['mysql']['master_slave_setup'] = 'y'; |
| | | } |
| | | |
| | | // Resolve the IP address of the mysql hostname. |
| | | if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); |
| | |
| | | if( empty($conf["mysql"]["admin_password"]) ) { |
| | | |
| | | $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); |
| | | } |
| | | |
| | | //** load the pre update sql script do perform modifications on the database before the database is dumped |
| | | if(is_file(ISPC_INSTALL_ROOT."/install/sql/pre_update.sql")) { |
| | | if($conf['mysql']['admin_password'] == '') { |
| | | caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/pre_update.sql' &> /dev/null", __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); |
| | | } else { |
| | | caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/pre_update.sql' &> /dev/null", __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); |
| | | } |
| | | } |
| | | |
| | | //** export the current database data |
| | |
| | | |
| | | //** Create the mysql database |
| | | $inst->configure_database(); |
| | | |
| | | //** Update master database rights |
| | | $inst->grant_master_database_rights(); |
| | | |
| | | //** empty all databases |
| | | $db_tables = $inst->db->getTables(); |
| | |
| | | //** Configure Apache |
| | | swriteln('Configuring Apache'); |
| | | $inst->configure_apache(); |
| | | |
| | | //** Configure vlogger |
| | | swriteln('Configuring vlogger'); |
| | | $inst->configure_vlogger(); |
| | | } |
| | | |
| | | |