Koha/Install

From Jon's Wiki

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.