1 #!/usr/bin/perl -w # please develop with -w
4 use strict
; # please develop with the strict pragma
8 *******************************************
9 * Welcome to the Koha Installation Guide
*
10 *******************************************
12 This installer will guide you through the process of installing Koha
.
13 It is
not a completely automated installation
, but a guide
for further
14 information please
read the documentation
or visit the Koha website at
17 To successfully
use Koha you need some additional software
:
19 * A webserver
(It was built to work with Apache
, but there is
no reason
20 it should
not work with any other webserver
).
22 * Mysql
(You could intead
use postgres
, or another sql based database
)
26 Are you ready to go through the installation process now?
(Y
/[N
]):
32 if ($answer eq "Y" || $answer eq "y") {
33 print "Beginning setup... \n";
36 When you are ready to complete the installation just run this installer again
.
45 # Test for Perl - Do we need to explicity check versions?
47 print "\nChecking that perl and the required modules are installed ...\n";
48 unless (eval "require 5.004") {
49 die "Sorry, you need at least Perl 5.004\n";
53 # Test for Perl Dependancies
56 unless (eval require DBI
) { push @missing,"DBI" };
57 unless (eval require Date
::Manip
) { push @missing,"Date::Manip" };
58 unless (eval require DBD
::mysql
) { push @missing,"DBD::mysql" };
59 unless (eval require Set
::Scalar
) { push @missing,"Set::Scalar" };
62 # Print out a list of any missing modules
66 print "You are missing some Perl modules which are required by Koha.\n";
67 print "Once these modules have been installed, rerun this installery.\n";
68 print "They can be installed by running (as root) the following:\n";
69 foreach my $module (@missing) {
70 print " perl -MCPAN -e 'install \"$module\"'\n";
73 print "Perl and required modules appear to be installed, continuing...\n";
83 Koha uses a small configuration file that is usually placed
in your
84 /etc/ files directory
(note
: if you wish to place the koha
.conf
in
85 another location you will need to manually edit additional files
).
87 We will help you to now create your koha
.conf file
, once this file
88 has been created
, please copy it to your destination folder
89 (note
: this may need to be done by your systems administrator
).
101 Please provide the name of the mysql database that you wish to
use
102 for koha
. This is normally
"Koha".
105 #Get the database name
107 print "Enter database name:";
108 chomp($dbname = <STDIN
>);
115 Please provide the hostname
for mysql
. Unless the database is located
116 on another machine this is likely to be
"localhost".
119 #Get the hostname for the database
121 print "Enter hostname:";
122 chomp($hostname = <STDIN
>);
129 Please provide the name of the mysql user
, who will have full administrative
130 rights to the
$dbname database
, when authenicating from
$hostname.
131 It is recommended that you
do not use your
"root" user
.
134 #Set the username for the database
136 print "Enter username:";
137 chomp($user = <STDIN
>);
144 Please provide a password
for the mysql user
$user.
147 #Set the password for the database user
149 print "Enter password:";
150 chomp($pass = <STDIN
>);
156 Please provide the full path to your Koha Intranet
/Librarians installation
.
157 Usually
/usr/local/www/koha
/htdocs
160 #Get the password for the database user
162 print "Enter installation path:";
163 chomp($inc_path = <STDIN
>);
167 #Create the configuration file
168 open(SITES
,">koha.conf") or die "Couldn't create file.
169 Must have write capability.\n";
175 includes=$inc_path/includes
180 print "Successfully created the Koha configuration file.\n";
185 #SETUP Virtual Host Directives
194 You need to setup your Apache configuration file
for the
197 Please enter the servername
for the OPAC interface
.
198 Usually opac
.your
.domain
201 print "Enter servername address:";
202 chomp($opac_svr_name = <STDIN
>);
207 Please enter the e
-mail address
for your webserver admin
.
208 Usually webmaster\
@your.domain
211 print "Enter e-mail address:";
212 chomp($opac_svr_admin = <STDIN
>);
217 Please enter the full path to your OPAC
\'s document root
.
218 usually something like
\"/usr/local/www/opac/htdocs
\".
221 print "Enter Document Roots Path:";
222 chomp($opac_docu_root = <STDIN
>);
227 # Update Apache Conf File.
229 open(SITES
,">>koha-apache.conf") or die "Couldn't write to file.
230 Must have write capability.\n";
233 <VirtualHost $opac_svr_name>
234 ServerAdmin $opac_svr_admin
235 DocumentRoot $opac_docu_root
236 ServerName $opac_svr_name
237 ErrorLog logs/opac-error_log
238 TransferLog logs/opac-access_log common
249 my $intranet_svr_admin;
250 my $intranet_svr_name;
253 You need to setup your Apache configuration file
for the
254 Intranet
/librarian virtual host
.
256 Please enter the servername
for your Intranet
/Librarian interface
.
257 Usually koha
.your
.domain
260 print "Enter servername address:";
261 chomp($intranet_svr_name = <STDIN
>);
266 Please enter the e
-mail address
for your webserver admin
.
267 Usually webmaster\
@your.domain
270 print "Enter e-mail address:";
271 chomp($intranet_svr_admin = <STDIN
>);
277 # Update Apache Conf File.
279 open(SITES
,">>koha-apache.conf") or die "Couldn't write to file.
280 Must have write capability.\n";
283 <VirtualHost $intranet_svr_name>
284 ServerAdmin $intranet_svr_admin
285 DocumentRoot $inc_path
286 ServerName $intranet_svr_name
287 ErrorLog logs/opac-error_log
288 TransferLog logs/opac-access_log common
296 print "Successfully created the Apache Virtual Host Configuration file.\n";
300 *******************************************
301 * Koha Installation Guide
- Continued
*
302 *******************************************
304 In order to finish the installation of Koha
, there is still a couple
305 of steps that you will need to complete
.
308 1. Create a new mysql database called
for example Koha
309 From command line
: mysqladmin
-uroot
-ppassword create Koha
311 2. Set up a koha user
and password
in mysql
312 Log
in to mysql
: mysql
-uroot
-ppassword
314 To create a user called
"koha" who has full administrative
315 rights to the
"Koha" database
when authenticating from
316 "localhost", enter the following on mysql command line
:
318 grant all privileges on Koha
.* to koha\
@localhost identified by
'kohapassword'\
;
320 Press ENTER
, and if you see
no errors then enter \q to quit mysql
.
323 3. Use the mysql script to create the tables
324 mysql
-uusername
-ppassword Koha
< koha
.mysql
326 4. Update your database tables
327 perl updatedatabase
-I
/pathtoC4
331 1. Copy Koha
.conf to
/etc/
332 If you wish to locate the file
in another location please
read
333 the INSTALL
and Hints files
.
340 print "\nCongratulations ... your Koha installation is complete!\n";
341 print "\nYou will need to restart your webserver before using Koha!\n";