Changeset 969

Show
Ignore:
Timestamp:
01/14/08 17:46:32 (8 months ago)
Author:
rats
Message:

fixed #55: update script ready for testing ... please do NOT use it on productive systems without backups; it's UNTESTED and may cause HEAVY DAMAGE!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r966 r969  
    66|                               * to fix: no errors on adding user (custom HP)    | 
    77\_________________________________________________________________/ 
     8 
     92008-01-14 Benedikt Heintel 
     10        - SETUP: 
     11                * Fixed #55: Update Script from VHCS 2.4.7.1 to ispCP ω 1.0.0 RC3 
     12                                                and from ispCP ω 1.0.0 RC2 to ispCP ω 1.0.0 RC3 
     13                * Fixed #955: "ispcp" Folder in /etc/apache2 is missing 
    814 
    9152008-01-13 Benedikt Heintel 
  • trunk/Makefile.centos

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp  
    4544 
    4645        cd ./configs && $(MAKE) install 
  • trunk/Makefile.fedora

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    4544 
    4645        cd ./configs && $(MAKE) install 
  • trunk/Makefile.gentoo

    r967 r969  
    4848        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    4949        $(SYSTEM_MAKE_DIRS) $(POSTFIX_SASLDB2_DIR) 
    50         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    5150 
    5251        cd ./configs && $(MAKE) install 
  • trunk/Makefile.opensuse10

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    4544 
    4645        cd ./configs && $(MAKE) install 
  • trunk/Makefile.sles9

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    4544 
    4645        cd ./configs && $(MAKE) install 
  • trunk/Makefile.suse10

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    4544 
    4645        cd ./configs && $(MAKE) install 
  • trunk/Makefile.ubuntu

    r967 r969  
    4242        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    4343        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    44         $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    4544 
    4645        cd ./configs/dists/ubuntu && $(MAKE) install 
  • trunk/configs/apache/Makefile

    r966 r969  
    1111        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/sites-available 
    1212        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/mods-available 
     13        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1314 
    1415        cp ./httpd.conf $(SYSTEM_CONF)/apache 
     
    3738        rm -rf $(APACHE_SITES_DIR)/00_master.conf 
    3839        rm -rf $(APACHE_SITES_DIR)/01_awstats.conf 
    39         rm -rf ${APACHE_MODS_DIR}/fastcgi_ispcp.conf 
     40        rm -rf $(APACHE_MODS_DIR)/fastcgi_ispcp.conf 
  • trunk/configs/dists/centos/apache/Makefile

    r847 r969  
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/sites-available 
    1010        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/mods-available 
     11        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1112 
    1213        cp ./httpd.conf ./working/ispcp.conf 
  • trunk/configs/dists/fedora/apache/Makefile

    r878 r969  
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/vhosts 
    1010        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/conf.d 
     11        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1112 
    1213        cp ./httpd.conf $(SYSTEM_CONF)/apache 
  • trunk/configs/dists/freebsd/apache/BSDmakefile

    r671 r969  
    88        $(SYSTEM_MAKE_DIRS) $(APACHE_EXT_CONF) 
    99        $(SYSTEM_MAKE_DIRS) $(APACHE_MOD_CONF) 
     10        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
     11 
    1012        cp ./httpd.conf ./working/ispcp.conf 
    1113        cp ./fastcgi.conf ./working/fastcgi_ispcp.conf 
  • trunk/configs/dists/openbsd/apache/BSDmakefile

    r671 r969  
    88        $(SYSTEM_MAKE_DIRS) $(APACHE_EXT_CONF) 
    99        $(SYSTEM_MAKE_DIRS) $(APACHE_MOD_CONF) 
     10        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
     11 
    1012        cp ./httpd.conf ./working/ispcp.conf 
    1113        cp ./fastcgi.conf ./working/fastcgi_ispcp.conf 
  • trunk/configs/dists/opensuse10/apache/Makefile

    r885 r969  
    88        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF) 
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/modules.d 
     10        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1011 
    1112        cp ./httpd.conf ./working/ispcp.conf 
  • trunk/configs/dists/redhat/apache/Makefile

    r785 r969  
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/sites-available 
    1010        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/mods-available 
     11        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1112 
    1213        cp ./httpd.conf ./working/ispcp.conf 
  • trunk/configs/dists/sles9/apache/Makefile

    r473 r969  
    88        $(SYSTEM_MAKE_DIRS) $(SYSTEM_CONF)/apache 
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF) 
     10        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1011 
    1112        cp ./httpd.conf ./working/ispcp.conf 
  • trunk/configs/dists/suse10/apache/Makefile

    r785 r969  
    88        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF) 
    99        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/modules.d 
     10        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1011 
    1112        cp ./httpd.conf ./working/ispcp.conf 
  • trunk/configs/dists/ubuntu/apache/Makefile

    r882 r969  
    1111        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/sites-available 
    1212        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/mods-available 
     13        $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp 
    1314 
    1415        cp ./httpd.conf $(SYSTEM_CONF)/apache 
  • trunk/docs/Debian/INSTALL

    r945 r969  
    212212        # cp -Rv /tmp/ispcp-1.0.0/var/* /var/ 
    213213 
    214 8. Now it's time to update your installation. Change into the engine directory: 
     2148. Backup ispcp.conf and copy the /etc dircetory into your system (you may make backups): 
     215        # mv -v /etc/ispcp/ispcp.conf /etc/ispcp/ispcp.old.conf 
     216        # cp -Rv /tmp/ispcp-1.0.0/etc/* /etc/ 
     217 
     2189. Now it's time to update your installation. Change into the engine directory: 
    215219        # cd /var/www/ispcp/engine/setup 
    216220 
    217 9. Start the engine update: 
     22110. Start the engine update: 
    218222        # perl ispcp-update 
    219223 
    220 10. Update ispCP ω step-by-step 
     22411. Update ispCP ω step-by-step 
    221225 
    222226        If you get no error, all went good; if you get one, look at 
    223227        http://isp-control.net to solve the problem. 
    224  
    225 11. Copy the new created configs into your system (you may make backups): 
    226         # cp -Rv /tmp/ispcp-1.0.0/etc/* /etc/ 
    227228 
    22822912. Clean the temporary folders: 
  • trunk/engine/setup/ispcp-setup

    r942 r969  
    12011201        return $rs if ($rs != 0); 
    12021202 
    1203  
    1204  
    12051203        $rs = make_dir($main::cfg{'LOG_DIR'}, 'root', 'root', 0755); 
    12061204 
     
    16951693        $data .= $resolv_data; 
    16961694 
    1697         # security fix: 
     1695               # security fix: 
    16981696        $resolv_data =~ s/^nameserver[[:space:]]+127\.0\.0\.1$//g; 
    16991697 
  • trunk/engine/setup/ispcp-update

    r966 r969  
    327327} 
    328328 
     329sub rebuild_configs { 
     330        push_el(\@main::el, 'rebuild_configs()', 'Starting...'); 
     331        do 'ispcp-setup'; 
     332 
     333        my $rs = undef; 
     334 
     335        # The folowing functions are specified in 'ispcp-setup' 
     336        $rs = setup_crontab(); 
     337        return 1 if ($rs != 0); 
     338 
     339        $rs = setup_named(); 
     340        return 2 if ($rs != 0); 
     341 
     342        $rs = setup_php_master_user_dirs(); 
     343        return 3 if ($rs != 0); 
     344 
     345        $rs = setup_php(); 
     346        return 4 if ($rs != 0); 
     347 
     348        $rs = setup_httpd(); 
     349        return 5 if ($rs != 0); 
     350 
     351        $rs = setup_mta(); 
     352        return 6 if ($rs != 0); 
     353 
     354        $rs = setup_po(); 
     355        return 7 if ($rs != 0); 
     356 
     357        $rs = setup_ftpd(); 
     358        return 8 if ($rs != 0); 
     359 
     360        $rs = setup_ispcpd(); 
     361        return 9 if ($rs != 0); 
     362 
     363        push_el(\@main::el, 'rebuild_configs()', 'Ending...'); 
     364        return 0; 
     365} 
     366 
    329367sub migrate_vhcs2 { 
    330368        push_el(\@main::el, 'migrate_vhcs2()', 'Starting...'); 
     
    511549        } 
    512550 
    513         # @TODO: find the new ispcp.conf and open it for writing. 
    514  
    515551        # update ispcp.conf 
     552        $main::cfg_file = '/etc/ispcp/ispcp.conf'; 
     553        $rs = get_conf(); 
     554        if ($rs != 0) { 
     555                exit_werror("failed to get /etc/ispcp/ispcp.conf!"); 
     556        } 
    516557        # copy changed variables to new ispcp.conf 
    517558        $rs = set_conf_val('DEFAULT_ADMIN_ADDRESS', $main::cfg{'DEFAULT_ADMIN_ADDRESS'}); 
     
    555596        return $rs if ($rs != 0); 
    556597 
    557         # TODO: check, if we store it in the right file! 
     598        # store into /etc/ispcp/ispcp.conf 
    558599        $rs = store_conf(); 
    559600        if ($rs != 0) { 
     
    581622    print STDOUT "done\n"; 
    582623 
    583     # @TODO: Rebuild system configs: 
    584     #                   -> /etc/apache2/mods-available/fastcgi_ispcp.conf 
    585     #                   -> /etc/proftpd/proftpd.conf 
    586     #                   -> /etc/ispcp/apache/01_awstats.conf 
    587     #                   ... (which ones missed?) 
     624    # Rebuild system configs: 
     625    print STDOUT "Rebuilding system configurations..."; 
     626 
     627        $rs = rebuild_configs(); 
     628 
     629        if ($rs != 0) { 
     630        print STDOUT "failed!\n"; 
     631                exit_werror("Config Rebuild failed."); 
     632        } 
     633 
     634        print STDOUT "done\n"; 
    588635 
    589636        push_el(\@main::el, 'patch_ispcp_rc2()', 'Ending...'); 
     
    592639 
    593640sub prepare_update { 
    594         my $rs = undef
     641        my ($rs, $rdata) = (undef, undef)
    595642 
    596643        push_el(\@main::el, 'user_dialog()', 'Starting...'); 
     
    628675        elsif ($main::ua{'update'} eq 3) { 
    629676                stop_services("/tmp/vhcs2-backup-all.lock"); 
     677 
     678                # get ispcp.old.conf 
     679                $main::cfg_file = '/etc/ispcp/ispcp.old.conf'; 
     680                $rs = get_conf(); 
     681                if ($rs != 0) { 
     682                        do { 
     683                                print STDOUT "\tPlease enter path to ispcp.old.conf [/etc/ispcp/ispcp.old.conf]: "; 
     684 
     685                                $rdata = readline(\*STDIN); 
     686                                chop($rdata); 
     687 
     688                                $main::cfg_file = $rdata; 
     689                                $rs = get_conf(); 
     690                        } while ($rs == 0); 
     691                } 
     692 
    630693                $rs = patch_ispcp_rc2(); 
    631694                return $rs if ($rs != 0);