Difference between revisions of "Koha/Install"

From Jon's Wiki
 
(14 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
  git clone git://git.koha.org/pub/scm/koha.git
 
  git clone git://git.koha.org/pub/scm/koha.git
  
=== PostgreSQL ===
+
I thought it had PostgreSQL support, but looks like that development effort died off. MySQL. Bleargh.
  
I thought it had, but there's lots of noise about MySQL. Bleargh.
+
== Install Dependencies ==
 +
 
 +
In Debian Lenny, all the dependencies for Koha are now in the main repository.
  
== Zebra Z39.50 Support ==
+
=== Zebra Z39.50 Support (Optional) ===
  
Add the [http://www.indexdata.dk/zebra/ Zebra] apt repository:
+
In Ubuntu, add the [http://www.indexdata.dk/zebra/ Zebra] apt repository:
 
  <nowiki>deb    http://ftp.indexdata.dk/debian indexdata/lenny released </nowiki>
 
  <nowiki>deb    http://ftp.indexdata.dk/debian indexdata/lenny released </nowiki>
 
  <nowiki>deb-src http://ftp.indexdata.dk/debian indexdata/lenny released </nowiki>
 
  <nowiki>deb-src http://ftp.indexdata.dk/debian indexdata/lenny released </nowiki>
 
And the magic key incantation:
 
And the magic key incantation:
 
  <nowiki>wget -q http://ftp.indexdata.dk/debian/indexdata.asc -O- | sudo apt-key add - </nowiki>
 
  <nowiki>wget -q http://ftp.indexdata.dk/debian/indexdata.asc -O- | sudo apt-key add - </nowiki>
 
== Install Dependencies ==
 
  
 
Install Zebra stuff:
 
Install Zebra stuff:
 
  sudo apt-get install yaz idzebra-2.0
 
  sudo apt-get install yaz idzebra-2.0
  
Perl dependencies:
+
=== Perl Dependencies ===
  
 
  sudo apt-get install libalgorithm-checkdigits-perl libbiblio-endnotestyle-perl \
 
  sudo apt-get install libalgorithm-checkdigits-perl libbiblio-endnotestyle-perl \
Line 40: Line 40:
 
  libxml-libxml-perl libxml-libxslt-perl libxml-namespacesupport-perl \
 
  libxml-libxml-perl libxml-libxslt-perl libxml-namespacesupport-perl \
 
  libxml-parser-perl libxml-perl libxml-regexp-perl libxml-rss-perl \
 
  libxml-parser-perl libxml-perl libxml-regexp-perl libxml-rss-perl \
  libxml-sax-perl libxml-simple-perl libxml-xslt-perl libyaml-syck-perl
+
  libxml-sax-perl libxml-simple-perl libxml-xslt-perl libyaml-syck-perl \
 +
libhtml-scrubber-perl libdata-uuid-perl libemail-date-perl libparams-util-perl
  
 
And from CPAN:
 
And from CPAN:
  
  Algorithm::CheckDigits::M43_001 GD::Barcode::UPCE MARC::File::XML
+
  sudo apt-get install dh-make-perl
 +
dh-make-perl --build --cpan CGI::Session
 +
dh-make-perl --build --cpan CGI::Session::Serialize::yaml
 +
dh-make-perl --build --cpan CGI::Session::YAML
 +
dh-make-perl --build --cpan Class::Adapter
 +
dh-make-perl --build --cpan SMS::Send
 +
sudo dpkg -i lib*-perl_*_all.deb
  
* DBD::mysql needs to be 4.004 or higher to handle UTF8 correctly.
+
* Note that in Ubuntu 8.10, Algorithm::CheckDigits::M43_001, GD::Barcode::UPCE and MARC::File::XML are included in libalgorithm-checkdigits-perl, libgd-barcode-perl and libmarc-xml-perl respectively.
* MARC::File::XML does not work with Perl 5.10, therefore the whole shebang probably requires downgrading Perl to 5.8
+
* '''DBD::mysql''' needs to be 4.004 or higher to handle UTF8 correctly.
 
* The Perl XML SAX Parser needs to be the libXML SAX Parser, not PurePerl or Expat, which are both rubbish. The following command should report ''XML::LibXML::SAX::Parser''. If it reports ''XML::SAX::Expat'', you need to edit /etc/perl/XML/SAX/ParserDetails.ini
 
* The Perl XML SAX Parser needs to be the libXML SAX Parser, not PurePerl or Expat, which are both rubbish. The following command should report ''XML::LibXML::SAX::Parser''. If it reports ''XML::SAX::Expat'', you need to edit /etc/perl/XML/SAX/ParserDetails.ini
 
  misc/sax_parser_print.pl
 
  misc/sax_parser_print.pl
  
 
+
== Configure UTF8 Locale ==
=== Locale UTF8 ===
 
  
 
Make sure the OS, Apache, and MySQL are all set to locale UTF8.
 
Make sure the OS, Apache, and MySQL are all set to locale UTF8.
Line 59: Line 65:
 
  AddDefaultCharset UTF-8
 
  AddDefaultCharset UTF-8
  
'''MySQL:''' Edit ''/etc/mysql/my.cnf'':
+
'''MySQL:''' Edit ''/etc/mysql/my.cnf'' under the [mysqld] section:
init-connect = 'SET NAMES utf8'
+
 
  default-character-set=utf8
+
  default-character-set = utf8
  character-set-server=utf8
+
  character-set-server = utf8
character_set_client=utf8
+
  skip-character-set-client-handshake # because the above settings don't actually work properly
collation-server=utf8_general_ci
 
  skip-character-set-client-handshake # because none of the above settings actually work
 
  
 
== Set Up Database ==
 
== Set Up Database ==
Line 83: Line 87:
 
  make test
 
  make test
 
  sudo make install
 
  sudo make install
 +
 +
The install notes that the following environment vars are useful for command-line batch jobs:
 +
export KOHA_CONF=/etc/koha/koha-conf.xml
 +
export PERL5LIB=/usr/share/koha/lib
  
 
=== Create an Apache Configuration ===
 
=== Create an Apache Configuration ===
  
Use ''etc/koha/koha-httpd.conf'' as a guide. Apache needs to listen on 8080, so add the following line to ''/etc/apache2/ports.conf'':
+
sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
 +
sudo a2enmod rewrite
 +
sudo a2ensite koha
 +
sudo apache2ctl restart
 +
 
 +
Apache also needs to listen on 8080, so add Listen 8080 to ''/etc/apache2/ports.conf''.
 +
 
 +
=== Setup Zebra ===
 +
 
 +
Manually set up zebra as a daemon. FFS. Install the daemon package:
 +
sudo apt-get install daemon
 +
 
 +
* Zebra Server:
 +
sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
 +
sudo update-rc.d koha-zebra-daemon defaults
 +
sudo /etc/init.d/koha-zebra-daemon start
 +
 
 +
* Zebra Queue Daemon:
 +
sudo ln -s /usr/share/koha/bin/koha-zebraqueue-ctl.sh /etc/init.d/koha-zebraqueue-daemon
 +
sudo update-rc.d koha-zebraqueue-daemon defaults
 +
sudo /etc/init.d/koha-zebraqueue-daemon start
 +
 
 +
=== Start up Koha ===
 +
 
 +
Point browser at http://localhost:8080/ and go through the tedious set up process...
 +
 
 +
== Conclusion ==
  
Listen 8080
+
;FAIL.: Too complicated.

Latest revision as of 10:23, 3 August 2009

Source Code

Grab the Koha source:

git clone git://git.koha.org/pub/scm/koha.git

I thought it had PostgreSQL support, but looks like that development effort died off. MySQL. Bleargh.

Install Dependencies

In Debian Lenny, all the dependencies for Koha are now in the main repository.

Zebra Z39.50 Support (Optional)

In Ubuntu, add the Zebra apt repository:

deb     http://ftp.indexdata.dk/debian indexdata/lenny released 
deb-src http://ftp.indexdata.dk/debian indexdata/lenny released 

And the magic key incantation:

wget -q http://ftp.indexdata.dk/debian/indexdata.asc -O- | sudo apt-key add - 

Install Zebra stuff:

sudo apt-get install yaz idzebra-2.0

Perl Dependencies

sudo apt-get install libalgorithm-checkdigits-perl libbiblio-endnotestyle-perl \
libcgi-session-perl libclass-accessor-perl libclass-factory-util-perl \
libdata-ical-perl libdate-calc-perl libdate-ical-perl libdate-manip-perl \
libdatetime-format-mail-perl libdatetime-format-strptime-perl \
libdatetime-format-w3cdtf-perl libdatetime-locale-perl libdatetime-perl \
libdatetime-timezone-perl libdbd-mysql-perl libdbi-perl libgd-barcode-perl \
libhtml-template-pro-perl libimage-magick-perl liblingua-ispell-perl \
liblingua-stem-perl liblist-moreutils-perl liblocale-gettext-perl \
liblocale-po-perl libmail-sendmail-perl libmarc-charset-perl \
libmarc-crosswalk-dublincore-perl libmarc-record-perl libmarc-xml-perl \
libmime-lite-perl libnet-ldap-perl libnet-z3950-zoom-perl libpdf-api2-perl \
libpdf-reuse-barcode-perl libpdf-reuse-perl libpoe-perl libschedule-at-perl \
libtext-charwidth-perl libtext-csv-perl libtext-csv-xs-perl libtext-iconv-perl \
libtext-wrapi18n-perl libtimedate-perl libtime-duration-perl \
libtime-format-perl libunix-syslog-perl libxml-dom-perl libxml-dumper-perl \
libxml-libxml-perl libxml-libxslt-perl libxml-namespacesupport-perl \
libxml-parser-perl libxml-perl libxml-regexp-perl libxml-rss-perl \
libxml-sax-perl libxml-simple-perl libxml-xslt-perl libyaml-syck-perl \
libhtml-scrubber-perl libdata-uuid-perl libemail-date-perl libparams-util-perl

And from CPAN:

sudo apt-get install dh-make-perl
dh-make-perl --build --cpan CGI::Session
dh-make-perl --build --cpan CGI::Session::Serialize::yaml
dh-make-perl --build --cpan CGI::Session::YAML
dh-make-perl --build --cpan Class::Adapter
dh-make-perl --build --cpan SMS::Send
sudo dpkg -i lib*-perl_*_all.deb
  • Note that in Ubuntu 8.10, Algorithm::CheckDigits::M43_001, GD::Barcode::UPCE and MARC::File::XML are included in libalgorithm-checkdigits-perl, libgd-barcode-perl and libmarc-xml-perl respectively.
  • DBD::mysql needs to be 4.004 or higher to handle UTF8 correctly.
  • The Perl XML SAX Parser needs to be the libXML SAX Parser, not PurePerl or Expat, which are both rubbish. The following command should report XML::LibXML::SAX::Parser. If it reports XML::SAX::Expat, you need to edit /etc/perl/XML/SAX/ParserDetails.ini
misc/sax_parser_print.pl

Configure UTF8 Locale

Make sure the OS, Apache, and MySQL are all set to locale UTF8.

Apache 2: Edit /etc/apache2/conf.d/charset:

AddDefaultCharset UTF-8

MySQL: Edit /etc/mysql/my.cnf under the [mysqld] section:

default-character-set = utf8
character-set-server = utf8
skip-character-set-client-handshake # because the above settings don't actually work properly

Set Up Database

In MySQL as root:

CREATE DATABASE koha DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON koha.* TO 'kohaadmin'@'localhost' IDENTIFIED BY 'whatever';
GRANT SELECT, INSERT, UPDATE, DELETE ON koha.* TO 'koha'@'localhost' IDENTIFIED BY 'whatever';
FLUSH PRIVILEGES;

Install Koha

From the code checkout, execute the following:

perl Makefile.PL
   (answer questions)
make
make test
sudo make install

The install notes that the following environment vars are useful for command-line batch jobs:

export KOHA_CONF=/etc/koha/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib

Create an Apache Configuration

sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
sudo a2enmod rewrite
sudo a2ensite koha
sudo apache2ctl restart

Apache also needs to listen on 8080, so add Listen 8080 to /etc/apache2/ports.conf.

Setup Zebra

Manually set up zebra as a daemon. FFS. Install the daemon package:

sudo apt-get install daemon
  • Zebra Server:
sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
sudo update-rc.d koha-zebra-daemon defaults
sudo /etc/init.d/koha-zebra-daemon start
  • Zebra Queue Daemon:
sudo ln -s /usr/share/koha/bin/koha-zebraqueue-ctl.sh /etc/init.d/koha-zebraqueue-daemon
sudo update-rc.d koha-zebraqueue-daemon defaults 
sudo /etc/init.d/koha-zebraqueue-daemon start

Start up Koha

Point browser at http://localhost:8080/ and go through the tedious set up process...

Conclusion

FAIL.
Too complicated.