starting to move ethnicity stuff out of programs and into modules
[koha.git] / installer.pl
1 #!perl 
2
3 print "**********************************\n";
4 print "* Welcome to the Koha Installer  *\n";
5 print "**********************************\n";
6 print "\n\n\n";
7 print "This installer will prompt you with a series of questions.\n";
8 print "It assumes you (or your system administrator) has installed: \n";
9 print "  * Apache (http://www.apache.org) \n";
10 print "  * Perl (http://www.perl.org) \n \n";
11 print "and one of the following database applications:";
12 print "  * MySql (http://www.mysql.org) \n\n";
13 print "on some type of Unix or Unix-like operating system \n";
14 print "\n\n";
15 print "Is Apache, Perl, and a database from the list above installed on this system?\n";
16 print "\n";
17 $answer = chomp $_;                      
18 if ($answer eq "Y") {
19         print "Great!  \n";
20   };
21 if ($answer eq "N") {
22         print "You will need to setup database space for your application.  \n";
23         print "The installer currently does not support an automated setup with this database.\n";
24         print "Please be sure to read the documentation.";
25   };
26 print "I need to unpack the Koha TarFile -- where is it?  ";
27 $answer = chomp $_;    
28 system("tar -x $answer"); #unpack fill out
29 #test for Perl and Apache?
30 print "Are you using MySql?[Y/N]: ";
31 $answer = chomp $_;                      
32 if ($answer eq "Y") {
33         system("mysqladmin -uroot -ppassword create $KohaDBNAME ");
34         system("mysql -u$root -p$password ");
35         #need to get to mysql prompt  HOW DO I DO THIS?
36         system("grant all privileges on Koha.* to koha@localhost identified by 'kohapassword'; ");
37
38   };
39 if ($answer eq "N") {
40         print "You will need to setup database space for your application.  \n";
41         print "The installer currently does not support an automated setup with this database.\n";
42   };
43 print "\n";
44 system ("perl updatedatabase -I /pathtoC4 ");
45
46 #KOHA conf
47 print "You will need to add the following to the Koha configuration file\n";
48 print "database=Koha\n";
49 print "hostname=localhost\n";
50 print "user=Koha\n";
51 print "pass=$password\n";
52 print "includes=/usr/local/www/koha/htdocs/includes\n";
53
54 #SETUP opac
55 #   <VirtualHost opac.your.site>                         
56 #   ServerAdmin webmaster@your.site                            
57 #   DocumentRoot /usr/local/www/opac/htdocs                     
58 #   ServerName opac.your.site                      
59 #   ErrorLog logs/opac-error_log       
60 #   TransferLog logs/opac-access_log               
61 #   </VirtualHost>
62
63
64 ###RESTART APACHE
65 system('/etc/rc.d/init.d/httpd restart');