--- doc/install/redhat7.3/install.pl 2002/06/19 19:16:54 1.1 +++ doc/install/redhat7.3/install.pl 2002/12/12 22:17:27 1.13 @@ -2,7 +2,7 @@ # The LearningOnline Network # Red Hat 7.3 installation script # -# $Id: install.pl,v 1.1 2002/06/19 19:16:54 matthew Exp $ +# $Id: install.pl,v 1.13 2002/12/12 22:17:27 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -24,6 +24,7 @@ # # http://www.lon-capa.org/ # + ## ## Obvious flaws of this program: ## Dieing on every error may be a little extreme. On the other hand, @@ -35,7 +36,50 @@ ## what nonsense we can put up with. Of course, we will have to ## explain that to people at some point... ## There is probably an overuse of elipses (...) in the comments. +## It might be nice to check that all the files we need are here. +## Appletalk is installed but does not work and gives errors on +## boot up. I have not been able to find a clean way to get the +## appletalk support working but the powers that be insist on it. ## + +# +# Needed files: +# +# The following files are assumed to be present in the current +# directory: +# RPMS: +# ImageMagick-5.4.3.11-1.i386.rpm +# ImageMagick-devel-5.4.3.11-1.i386.rpm +# ImageMagick-perl-5.4.3.11-1.i386.rpm +# gnuplot-3.7.1-5.i386.rpm +# libgd-1.3-4.i386.rpm +# libungif-progs-4.1.0-9.i386.rpm +# ncurses4-5.0-5.i386.rpm +# readline-2.2.1-6.i386.rpm +# readline-4.2a-4.i386.rpm +# perl-DBD-MySQL-1.2216-4.i386.rpm +# perl-DBI-1.21-1.i386.rpm +# mod_perl-1.26-5.i386.rpm +# perl-suidperl-5.6.1-34.99.6.i386.rpm +# LONCAPA-0.6.0-1.i386.rpm +# mysql-3.23.49-3.i386.rpm +# mysqlclient9-3.23.22-6.i386.rpm +# mysql-server-3.23.49-3.i386.rpm +# hwcrypto-1.0-3.i386.rpm +# m2crypto-0.05_snap4-2.i386.rpm +# netpbm-9.24-3.i386.rpm +# netpbm-progs-9.24-3.i386.rpm +# krb5-libs-1.2.4-3.i386.rpm +# Other files: +# httpd.conf +# mod_auth_external-2.1.13.tar.gz +# +# The contingency plan for a 7.2 install tells the user to install these +# from the current directory. +# perl-5.6.1-34.99.6.i386.rpm +# perl-CGI-2.752-34.99.6.i386.rpm +# + use strict; use File::Copy; @@ -103,7 +147,7 @@ END print <<"END"; ******************************************************************** - Welcome to LON-CAPA + Welcome to LON-CAPA 0.6.0 This script will install the base software that LON-CAPA needs to run properly. @@ -120,6 +164,27 @@ chomp($instdir); # This list of rpms needs to be pared down to some extent. # +my @apache_rpms = ( + "$instdir/apache-1.3.23-14.i386.rpm" + ); + +my @openssh_rpms = ( + "$instdir/openssh-3.1p1-6.i386.rpm", + "$instdir/openssh-askpass-3.1p1-6.i386.rpm", + "$instdir/openssh-clients-3.1p1-6.i386.rpm", + "$instdir/openssh-server-3.1p1-6.i386.rpm" + ); +# Check for gnome-askpass installation. +if (-e "/etc/profile.d/gnome-ssh-askpass.sh") { + push @openssh_rpms,"$instdir/openssh-askpass-gnome-3.1p1-6.i386.rpm"; +} + +my @ImageMagick_rpms = ( + "$instdir/ImageMagick-5.4.3.11-1.i386.rpm", + "$instdir/ImageMagick-devel-5.4.3.11-1.i386.rpm", + "$instdir/ImageMagick-perl-5.4.3.11-1.i386.rpm", + ); + my @gnuplot_rpms = ( "$instdir/gnuplot-3.7.1-5.i386.rpm", "$instdir/libgd-1.3-4.i386.rpm", @@ -135,7 +200,12 @@ my @perl_rpms = ( "$instdir/perl-suidperl-5.6.1-34.99.6.i386.rpm", ); my @loncapa_perl_rpms = ( - "$instdir/LON-CAPA-systemperl-3.4-rh72.i386.rpm" + "$instdir/LONCAPA-0.6.0-1.i386.rpm", + "$instdir/netpbm-9.24-3.i386.rpm", + "$instdir/netpbm-progs-9.24-3.i386.rpm", + "$instdir/krb5-libs-1.2.4-3.i386.rpm", + "$instdir/krb5-devel-1.2.4-3.i386.rpm", + "$instdir/LON-CAPA-krb4-3.1-1.i386.rpm", ); my @mysql_rpms = ( "$instdir/mysql-3.23.49-3.i386.rpm", # okay w/o f,nd @@ -145,13 +215,21 @@ my @mysql_rpms = ( my @misc_rpms = ( "$instdir/hwcrypto-1.0-3.i386.rpm", # already installed "$instdir/m2crypto-0.05_snap4-2.i386.rpm", # okay w/o f,nd - "$instdir/netatalk-1.5pre6-1rh7.i386.rpm" # hmmmm + "$instdir/tetex-dvips-1.0.7-47.i386.rpm" ); ## ## Okay, I have tried being nice about this and not doing '--force --nodeps', ## but it is an exercise in frustration. It would be nice to be kind, but ## frankly I do not want to spend the time to figure this out. ## + +print_and_log("Installing Apache packages.\n"); +writelog (`rpm -Uvh @apache_rpms`); +print_and_log("Installing openssh packages.\n"); +writelog (`rpm -Uvh @openssh_rpms`); +system("/etc/init.d/sshd start"); +print_and_log("Installing ImageMagick packages.\n"); +writelog (`rpm -ivh --force --nodeps @ImageMagick_rpms`); print_and_log("Installing mysql packages.\n"); writelog (`rpm -ivh --force --nodeps @mysql_rpms`); print_and_log("Installing gnuplot packages.\n"); @@ -162,7 +240,6 @@ print_and_log("Installing Perl packages. writelog (`rpm -ivh --force --nodeps @perl_rpms`); print_and_log("Installing misc packages.\n"); writelog (`rpm -ivh --force --nodeps @misc_rpms`); -system("/etc/init.d/sshd start"); print_and_log("\n"); ## @@ -265,8 +342,11 @@ writelog("mysql links created successful writelog(`/etc/rc.d/init.d/mysqld start`); print_and_log("Waiting for mysql daemon to start.\n"); sleep 5; -if (`/etc/rc.d/init.d/mysqld status` !~ / is running/) { +my $status = system("/etc/rc.d/init.d/mysqld status"); +if ($status != 0) { die "Unable to start mysql daemon\nHalting\n"; +} else { + print_and_log("Mysql daemon is running.\n"); } print_and_log("\n"); @@ -291,7 +371,8 @@ print MYSQL <<"ENDMYSQL"; CREATE DATABASE loncapa; INSERT INTO user (Host, User, Password) VALUES ('localhost','www',password('localhostkey')); -GRANT ALL PRIVILEGES ON *.* TO www\@localhost; +INSERT INTO db VALUES ('localhost','loncapa','www', +'Y','Y','Y','Y','Y','Y','N','Y','Y','Y'); SET PASSWORD FOR root\@localhost=PASSWORD('$rootpass'); DELETE FROM user WHERE host<>'localhost'; FLUSH PRIVILEGES; @@ -352,23 +433,23 @@ print_and_log("\n"); ## ## Retrieve loncapa.tar.gz ## -if (! -e "$instdir/loncapa.tar.gz") { +if (! -e "$instdir/loncapa-current.tar.gz") { print_and_log("Retrieving LON-CAPA source files from install.loncapa.org\n"); - system("wget http://install.loncapa.org/versions/current/loncapa.tar.gz 2>/dev/null 1>/dev/null"); - if (! -e "./loncapa.tar.gz") { + system("wget http://install.loncapa.org/versions/loncapa-current.tar.gz 2>/dev/null 1>/dev/null"); + if (! -e "./loncapa-current.tar.gz") { die("Unable to retrieve LON-CAPA source files from\n". - "http://install.loncapa.org/versions/current/loncapa.tar.gz\n"); + "http://install.loncapa.org/versions/loncapa-current.tar.gz\n"); } print_and_log("\n"); } else { print_and_log(<<"END"); ------------------------------------------------------------------------ -You seem to have a version of loncapa.tar.gz in $instdir. +You seem to have a version of loncapa-current.tar.gz in $instdir. This copy will be used and a new version will NOT be downloaded. If you wish, you may download a new version by executing: -wget http://install.loncapa.org/versions/current/loncapa.tar.gz +wget http://install.loncapa.org/versions/loncapa-current.tar.gz ------------------------------------------------------------------------ END @@ -378,7 +459,7 @@ END ## untar loncapa.tar.gz ## print_and_log("Extracting LON-CAPA source files\n"); -writelog(`cd ~root; tar zxf $instdir/loncapa.tar.gz`); +writelog(`cd ~root; tar zxf $instdir/loncapa-current.tar.gz`); print_and_log("\n"); my $version = `cat /etc/redhat-release`; @@ -389,7 +470,7 @@ commands now: rpm -Uvh perl-5.6.1-34.99.6.i386.rpm rpm -Uvh perl-CGI-2.752-34.99.6.i386.rpm -cd /root/loncapa +cd /root/loncapa-N.N (N.N should correspond to a version number like '0.4') ./UPDATE END @@ -401,12 +482,13 @@ END All of the extra files seem to have been installed correctly. It remains for you to execute the following commands: -cd /root/loncapa; +cd /root/loncapa-N.N (N.N should correspond to a version number like '0.4') ./UPDATE -If you have any trouble, please see http://install.loncapa.org and -http://help.loncapa.org. +If you have any trouble, please see http://install.loncapa.org/ and +http://help.loncapa.org/. ENDMSG } close LOG; +