Example #1
0
$clientdb_host = '';
$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 {
Example #2
0
//** Get distribution identifier
$dist = get_distname();
if ($dist['id'] == '') {
    die('Linux distribution or version not recognized.');
}
//** Include the distribution-specific installer class library and configuration
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';
//****************************************************************************************************
//** Installer Interface
//****************************************************************************************************
$inst = new installer();
swriteln($inst->lng('    Following will be a few questions for primary configuration so be careful.'));
swriteln($inst->lng('    Default values are in [brackets] and can be accepted with <ENTER>.'));
swriteln($inst->lng('    Tap in "quit" (without the quotes) to stop the installer.' . "\n\n"));
//** Check log file is writable (probably not root or sudo)
if (!is_writable(dirname(ISPC_LOG_FILE))) {
    die("ERROR: Cannot write to the " . dirname(ISPC_LOG_FILE) . " directory. Are you root or sudo ?\n\n");
}
if (is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) {
    die('This software cannot be installed on a server wich runs ISPConfig 2.x.');
}
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