function installmailserver() { global $app, $ehcpinstalldir, $ip, $hostname, $user_email, $user_name, $ehcpmysqlpass, $rootpass, $newrootpass, $ehcpadminpass, $installmode, $unattended; echo "starting mail server installation (postfix and related programs)\n\n"; # If /etc/postfix/main.cf does not exist, it must exist before unattended install will work properly with PostFix # See here: # http://www.whatastruggle.com/postfix-non-interactive-install # Added by Eric Arnol-Martin <*****@*****.**> if ($unattended) { copyPostFixConfig(); } # Install these packages and answer configuration questions if unattended # Then install the rest of the packages # Added by Eric Arnol-Martin <*****@*****.**> # Place these functions wherever you want in your switch statement... they are currently here for testing switch ($installmode) { case 'extra': case 'normal': installRoundCube(); installPHPMYAdmin(); case 'light': aptget(array('postfix', 'postfix-mysql'), False, True); aptget(array('courier-authdaemon', 'courier-authlib-mysql', 'courier-pop', 'courier-pop-ssl', 'courier-imap', 'courier-imap-ssl', 'libsasl2-2', 'libsasl2', 'libsasl2-modules', 'libsasl2-modules-sql', 'sasl2-bin', 'libpam-mysql', 'openssl', 'pop-before-smtp'), False, True); # changed libsasl2-2 to libsasl2 ** break; default: echo "Unknown installmode parameter at " . __LINE__; } check_restart_mysql(); passthru2("cp -rf /usr/share/phpmyadmin /var/www/new"); # aptitude install postfix postfix-mysql postfix-doc mysql-client courier-authdaemon courier-authmysql courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl phpmyadmin pop-before-smtp #remove: apt-get remove postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authmysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl phpmyadmin bosluk2(); # all mail configuration should be moved into this function: ehcpdeveloper, to be able to re-configure mail later mailconfiguration(array('ehcppass' => $ehcpmysqlpass)); mailNameFix(); echo "\n\nfinished mail server,pop3,imap installation \n"; }
function updatecleanup() { setPrepareKloxo(); // Fixes #303 and #304 installThirdparty(); install_gd(); install_bogofilter(); setInitialPhpMyAdmin(); setInitialAdminAccount(); setInitialKloxoPhp(); installWebmail(); installAwstats(); setRemoveOldDirs(); setInitialBinary(); log_cleanup("Remove lighttpd errorlog"); log_cleanup("- Remove process"); remove_lighttpd_error_log(); log_cleanup("Fix the secure logfile"); log_cleanup("- Fix process"); call_with_flag("fix_secure_log"); log_cleanup("Clean hosts.deny"); log_cleanup("- Clean process"); call_with_flag("remove_host_deny"); log_cleanup("Turn off mouse daemon"); log_cleanup("- Turn off process"); system("chkconfig gpm off"); if (lxfile_exists("phpinfo.php")) { log_cleanup("Remove phpinfo.php"); log_cleanup("- Remove process"); lxfile_rm("phpinfo.php"); } setInitialBind(); log_cleanup("Killing gettraffic system process"); log_cleanup("- Killing process"); lxshell_return("pkill", "-f", "gettraffic"); setCheckPackages(); copy_script(); install_xcache(); log_cleanup("Install Kloxo service"); log_cleanup("- Install process"); lxfile_unix_chmod("/etc/init.d/kloxo", "0755"); system("chkconfig kloxo on"); setJailshellSystem(); log_cleanup("Set /home permission to 0755"); log_cleanup("- Set process"); lxfile_unix_chmod("/home", "0755"); setExecuteCentos5Script(); fix_rhn_sources_file(); setInitialApacheConfig(); setInitialPureftpConfig(); setInstallMailserver(); log_cleanup("Enable xinetd service"); log_cleanup("- Enable process"); call_with_flag("enable_xinetd"); fix_suexec(); if (!lxfile_exists("/usr/bin/php-cgi")) { log_cleanup("Initialize php-cgi binary"); log_cleanup("- Initialize process"); lxfile_cp("/usr/bin/php", "/usr/bin/php-cgi"); } setSomePermissions(); setInitialLighttpdConfig(); setInitialNobodyScript(); setSomeScript(); log_cleanup("Install /etc/init.d/djbdns service file"); log_cleanup("- Install process"); lxfile_cp("../file/djbdns.init", "/etc/init.d/djbdns"); removeOtherDrivers(); log_cleanup("Remove cache dir"); log_cleanup("- Remove process"); lxfile_rm_rec("__path_program_root/cache"); log_cleanup("Restart syslog service"); log_cleanup("- Restart process"); createRestartFile('syslog'); log_cleanup("Initialize awstats dirdata"); log_cleanup("- Initialize process"); lxfile_mkdir("/home/kloxo/httpd/awstats/dirdata"); setInitialLogrotate(); installRoundCube(); installHorde(); installChooser(); log_cleanup("Remove old lxlabs ssh key"); log_cleanup("- Remove process"); remove_ssh_self_host_key(); setInitialServer(); setDefaultPages(); installInstallApp(); setFreshClam(); changeMailSoftlimit(); }