Beispiel #1
0
function installfinish()
{
    global $ehcpinstalldir, $ehcpmysqlpass, $app, $user_email, $user_name, $header, $installextrasoftware, $lightinstall, $installmode, $emailenable;
    switch ($installmode) {
        case 'extra':
            aptget(array('postgrey', 'ffmpeg', 'php5-ffmpeg', 'mplayer', 'mencoder', 'nmap', 'listadmin', 'spamassassin', 'aptitude', 'gpac', 'clamav', 'clamav-freshclam', 'libavcodec-unstripped', 'byobu'));
        case 'normal':
            aptget(array('webalizer', 'php-pear', 'phpsysinfo', 'mailutils'));
        case 'light':
            aptget(array('bind9-host', 'php5-curl', 'php5-xmlrpc', 'php5-imap'));
            break;
        default:
            echo "Unknown installmode parameter at " . __LINE__;
    }
    # gpac : includes mp4box and similar multimedia required by some media websites (clipbucket)
    # ekle();
    echo "finishing install...\n";
    # to make phpsysinfo work as in /var/www
    chdir('/var/www/new');
    passthru2("wget http://ehcp.net/diger/templates.tgz", True);
    # orjinal installer dosyasını küçültmek için
    passthru2("tar -zxf templates.tgz");
    passthru2('ln -s /usr/share/phpsysinfo phpsysinfo');
    chdir($ehcpinstalldir);
    # app already setupd in installsql function..
    $app->loadConfig();
    // loads dns ip and other thing
    $app->adjust_webmail_dirs();
    writeoutput($app->conf['namedbase'] . "/named_ehcp.conf", "", "w");
    # $app->addDaemonOp("syncdns",'','','','sync dns'); # no need to sync, since ehvp ver  0.29.15, because before it, 0 # of domains caused ehcp to crash., now not.
    # echo "syncdns finished\n";
    # $app->syncdomains($app->ehcpdir."/apachehcp.conf");
    passthru("service sendmail stop");
    # phpmyadmin normalde kurmasina ragmen, bidefasinda, kurmus, ama configurasyon dosyasini atamamis. bu nedenle ekledim bunu..
    if (!file_exists("/etc/apache2/conf.d/phpmyadmin.conf")) {
        passthru2("mkdir -p /etc/apache2/conf.d");
        passthru2("cp ./phpmyadmin.conf /etc/apache2/conf.d/");
    }
    /*
    	$filecontent="This is default ehcp-apache index file. <br><a href=/vhosts/ehcp>click here for ehcp home on your server</a><br><br>
    	<a target=_blank href=http://www.ehcp.net>ehcp Home</a>";
    	writeoutput("/var/www/apache2-default/index.html",$filecontent);
    	writeoutput("/var/www/index.html",$filecontent);*/
    passthru("php5enmod mcrypt");
    passthru("ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available");
    # fix if missing; http://ehcp.net/?q=comment/3072#comment-3072
    echo "\nPlease wait while services restarting...\n\n";
    passthru("service apache2 restart");
    passthru("service bind9 restart");
    passthru("service postfix restart");
    passthru("cp /etc/apt/sources.list.bck.ehcp /etc/apt/sources.list");
    replacelineinfile("exit 0", "/etc/init.d/ehcp restart", "/etc/rc.local");
    $add = "/var/log/ehcp.log /var/log/apache_common_access_log {\n}";
    add_if_not_exists2($add, '/etc/logrotate.d/ehcp', True);
    # adjust logrotate for ehcp logs # we need to do this for domain logs too
    sleep(2);
    check_restart_mysql();
    passthru2("update-rc.d -f nginx remove");
    passthru2("update-rc.d apache2 defaults");
    passthru("service apparmor teardown");
    // passthru("cd /var/www/ehcp");
    echo "now, starting panel daemon \n";
    // passthru("nohup php index.php daemon > /dev/null & ");
    #launchpanel()
    bosluk();
    cizgi();
    #echo "finished installation , bye ! \n"; # not finished yet, something is done in install.sh
    bosluk();
    $msg = "\nCongratulations !\nYour ehcp (Easy Hosting Control Panel) installation completed.\nnow, navigate to your panel located at http://yourip, whatever is your ip.\n\nif you need assistance, you may click troubleshoot in front page, have a look at forum section at www.ehcp.net,\nor you may contact ehcp developer directly at email/msn: info@ehcp.net\n\nThank you for choosing and trying ehcp !\n\n\n";
    if ($user_email and $emailenable) {
        @mail($user_email, "your ehcp install completed.", $msg, $header);
    }
}
Beispiel #2
0
 function replaceOrAddLineInFile($find, $replace, $where)
 {
     return replacelineinfile($find, $replace, $where, true);
 }