Exemplo n.º 1
0
$clientdb_user = '';
$clientdb_password = '';
include_once "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
$conf["mysql"]["admin_user"] = $clientdb_user;
$conf["mysql"]["admin_password"] = $clientdb_password;
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
//** Test mysql root connection
$finished = false;
do {
    if (@mysql_connect($conf["mysql"]["host"], $conf["mysql"]["admin_user"], $conf["mysql"]["admin_password"])) {
        $finished = true;
    } else {
        swriteln($inst->lng('Unable to connect to mysql server') . ' ' . mysql_error());
        $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password'], 'mysql_root_password');
    }
} while ($finished == false);
unset($finished);
/*
 *  Prepare the dump of the database
 */
prepareDBDump();
//* initialize the database
$inst->db = new db();
//* initialize the master DB, if we have a multiserver setup
if ($conf['mysql']['master_slave_setup'] == 'y') {
    //** Get MySQL root credentials
    $finished = false;
    do {
        $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'], 'mysql_master_hostname');
Exemplo n.º 2
0
if (is_dir('/usr/local/ispconfig')) {
    die('ISPConfig 3 installation found. Please use update.php instead if install.php to update the installation.');
}
//** Detect the installed applications
$inst->find_installed_apps();
//** Select the language and set default timezone
$conf['language'] = $inst->simple_query('Select language', array('en', 'de'), 'en');
$conf['timezone'] = get_system_timezone();
//* Set defaukt theme
$conf['theme'] = 'default';
//** 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]);
unset($tmp_out);
// Check if the mysql functions are loaded in PHP
if (!function_exists('mysql_connect')) {
    die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.');
}
//** Get MySQL root credentials
$finished = false;
do {
    $tmp_mysql_server_host = $inst->free_query('MySQL server hostname', $conf['mysql']['host']);
    $tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user']);
    $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");