From 46427ca3077e1424a8bb70e575058f4f87cf470d Mon Sep 17 00:00:00 2001 From: tonnesen Date: Thu, 25 Jul 2002 18:07:32 +0000 Subject: [PATCH] Finished modularizing installer.pl --- Install.pm | 74 +++++++++++++++++++++++++++++++++ installer.pl | 115 ++------------------------------------------------- 2 files changed, 78 insertions(+), 111 deletions(-) diff --git a/Install.pm b/Install.pm index 3add30e898..2ca1fd58ef 100644 --- a/Install.pm +++ b/Install.pm @@ -21,6 +21,7 @@ $VERSION = 0.01; &basicauthentication &installfiles &databasesetup + &restartapache ); @@ -147,6 +148,44 @@ Specify a log directory where any Koha daemons can create log files. Koha Log Directory [%s]: |; +$messages->{'AuthenticationWarning'}->{en}=qq| +================== += Authentication = +================== + +This release of Koha has a new authentication module. If you are not already +using basic authentication on your intranet, you will be required to log in to +access some of the features of the intranet. You can log in using the userid +and password from the /etc/koha.conf configuration file at any time. Use the +"Members" module to add passwords for other accounts and set their permissions. + +[NOTE PERMISSIONS ARE NOT COMPLETED AS OF THIS RELEASE. Do not give passwords +to any patrons unless you want them to have full access to your intranet.] + +print "Press the key to continue: |; + +$messages->{'Completed'}->{en}=qq| +============================== += KOHA INSTALLATION COMPLETE = +============================== + +Congratulations ... your Koha installation is complete! + +You will be able to connect to your Librarian interface at: + + http://%s\:%s/ + +and the OPAC interface at : + + http://%s\:%s/ + + +Be sure to read the INSTALL, and Hints files. + +For more information visit http://www.koha.org + +Press to exit the installer: |; + sub releasecandidatewarning { my $message=getmessage('ReleaseCandidateWarning', [$::kohaversion, $::kohaversion]); my $answer=showmessage($message, 'yn', 'n'); @@ -930,6 +969,13 @@ httpduser=$::httpduser chown((getpwnam($::httpduser)) [2,3], "$::etcdir/koha.conf") or warn "can't chown koha.conf: $!"; chmod 0440, "$::etcdir/koha.conf"; + + chmod 0750, "$::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh"; + chmod 0750, "$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh"; + chmod 0750, "$::intranetdir/scripts/z3950daemon/processz3950queue"; + chown(0, (getpwnam($::httpduser)) [3], "$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!"; + chown(0, (getpwnam($::httpduser)) [3], "$::intranetdir/scripts/z3950daemon/processz3950queue") or warn "can't chown $::intranetdir/scripts/z3950daemon/processz3950queue: $!"; + } $messages->{'MysqlRootPassword'}->{en}=qq| @@ -1094,5 +1140,33 @@ sub databasesetup { } +$messages->{'RestartApache'}->{en}=qq| +================== += RESTART APACHE = +================== + +Apache needs to be restarted to load the new configuration for Koha. + +Would you like to restart Apache now? [Y]/N: |; + +sub restartapache { + + my $response=showmessage(getmessage('RestartApache'), 'yn', 'y'); + + + + unless ($response=~/^n/i) { + # Need to support other init structures here? + if (-e "/etc/rc.d/init.d/httpd") { + system('/etc/rc.d/init.d/httpd restart'); + } elsif (-e "/etc/init.d/apache") { + system('/etc//init.d/apache restart'); + } elsif (-e "/etc/init.d/apache-ssl") { + system('/etc/init.d/apache-ssl restart'); + } + } + +} + END { } # module clean-up code here (global destructor) diff --git a/installer.pl b/installer.pl index 173d3ce774..a0e4f817a6 100644 --- a/installer.pl +++ b/installer.pl @@ -86,118 +86,11 @@ installfiles(); databasesetup(); +restartapache(); -exit; +showmessage(getmessage('AuthenticationWarning'), 'PressEnter'); +showmessage(getmessage('Completed', [ $::servername, $::intranetport, $::servername, $::opacport]), 'PressEnter'); + -# LAUNCH SCRIPT -print "Modifying Z39.50 daemon launch script...\n"; -my $newfile=''; -open (L, "$::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh"); -while () { - if (/^RunAsUser=/) { - $newfile.="RunAsUser=$::httpduser\n"; - } elsif (/^KohaZ3950Dir=/) { - $newfile.="KohaZ3950Dir=$::intranetdir/scripts/z3950daemon\n"; - } else { - $newfile.=$_; - } -} -close L; -system("mv $::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh $::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh.orig"); -open L, ">$::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh"; -print L $newfile; -close L; - - -# SHELL SCRIPT -print "Modifying Z39.50 daemon wrapper script...\n"; -$newfile=''; -open (S, "$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh"); -while () { - if (/^KohaModuleDir=/) { - $newfile.="KohaModuleDir=$::intranetdir/modules\n"; - } elsif (/^KohaZ3950Dir=/) { - $newfile.="KohaZ3950Dir=$::intranetdir/scripts/z3950daemon\n"; - } elsif (/^LogDir=/) { - $newfile.="LogDir=$::kohalogdir\n"; - } else { - $newfile.=$_; - } -} -close S; - -system("mv $::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh $::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh.orig"); -open S, ">$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh"; -print S $newfile; -close S; -chmod 0750, "$::intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh"; -chmod 0750, "$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh"; -chmod 0750, "$::intranetdir/scripts/z3950daemon/processz3950queue"; -chown(0, (getpwnam($::httpduser)) [3], "$::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $::intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!"; -chown(0, (getpwnam($::httpduser)) [3], "$::intranetdir/scripts/z3950daemon/processz3950queue") or warn "can't chown $::intranetdir/scripts/z3950daemon/processz3950queue: $!"; - -print qq| - -================== -= Authentication = -================== - -This release of Koha has a new authentication module. If you are not already -using basic authentication on your intranet, you will be required to log in to -access some of the features of the intranet. You can log in using the userid -and password from the /etc/koha.conf configuration file at any time. Use the -"Members" module to add passwords for other accounts and set their permissions. - -[NOTE PERMISSIONS ARE NOT COMPLETED AS OF 1.2.3RC1. Do not give passwords to - any patrons unless you want them to have full access to your intranet.] -|; -print "Press the key to continue: "; -; - - -#RESTART APACHE -print "\n\n"; -#print qq| -# -#COMPLETED -#========= -#Congratulations ... your Koha installation is almost complete! -#The final step is to restart your webserver. -# -#You will be able to connect to your Librarian interface at: -# -# http://$servername\:$kohaport/ -# -#and the OPAC interface at : -# -# http://$servername\:$opacport/ -# -# -#Be sure to read the INSTALL, and Hints files. -# -#For more information visit http://www.koha.org -# -#Would you like to restart your webserver now? (Y/[N]): -#|; - -my $restart = ; -chomp $restart; - -if ($restart=~/^y/i) { - # Need to support other init structures here? - if (-e "/etc/rc.d/init.d/httpd") { - system('/etc/rc.d/init.d/httpd restart'); - } elsif (-e "/etc/init.d/apache") { - system('/etc//init.d/apache restart'); - } elsif (-e "/etc/init.d/apache-ssl") { - system('/etc/init.d/apache-ssl restart'); - } - } else { - print qq| -Congratulations ... your Koha installation is complete! -You will need to restart your webserver before using Koha! -|; - exit; -}; -- 2.39.5