Koha Croatian user group
Koha instalacija: Revision 34

Ova stranica će pokušati dokumentirati instalaciju kohe na najjednostavniji mogući način. Primjeri za korištenje su:

  • demo instanca
  • development instanca
  • recovery iz backup-a ili testiranje sa zadnjom verzijom kohe iz git-a (potreban je samo dump baze)

Cijela virtualna mašina dostupna je kao ~325 Mb download: http://mjesec.ffzg.hr/~dpavlin/koha/koha-lxc-20091207.tar.bz2

Oprez: ova virtualna mašina nema root password a svi ostali passwordi su dokumentirani na ovoj stranici, tako da je mudro promjeniti ih ako je želite koristiti!!



Virtualna mašina

Instalacija u LXC (Linux containers) ali bilo koja instalacija bi trebala biti jednako dobra.

root@t61p:~# lxc-debian create
What is the name for the container ? [debian] koha-lxc
What hostname do you wish for this container ? [koha-lxc] 
What IP address do you wish for this container ? [172.20.0.21] 192.168.3.3
What is the gateway IP address ? [172.20.0.1] 192.168.3.1
What is the MTU size ? [1500] 
Specify the location of the rootfs [./rootfs.koha-lxc] /virtual/koha-lxc
Specify the location for an extra fstab file [(none)] 
Choose your architecture
1) amd64
2) i386
#? 2
Architecture i386 selected
Checking cache download ...Found.
Copying rootfs ...

...

Za locale bi bilo zgodno instalirati:

  • en_US.UTF-8 UTF-8
  • hr_HR.UTF-8 UTF-8

Default locale for the system environment: None

root@t61p:~# lxc-start --name koha-lxc

Naša virtualna mašina se zove koha-lxc i da bi Koha testovi prošli mora biti moguće resolvati to DNS ime. Provjerite da /etc/hosts ima zapis:

koha-lxc:/srv/koha# grep koha-lxc /etc/hosts
192.168.3.3     koha-lxc

Dodatni paketi

koha-lxc:~# apt-get install vim less openssh-server git-core dselect

Zebra

koha-lxc:/srv/koha# cat > /etc/apt/sources.list.d/indexdata.list
deb http://ftp.indexdata.dk/debian lenny main
deb-src http://ftp.indexdata.dk/debian lenny main

GIT

koha-lxc:~# cd /srv/
koha-lxc:/srv# git clone git://git.koha.org/pub/scm/koha.git
Initialized empty Git repository in /srv/koha/.git/
...

Ostatak instalacije manje-više slijedi upute od Kohe: INSTALL.debian-lenny

Lokalni branch

Napraviti lokalni branch za ovu intalaciju:

koha-lxc:/srv/koha# git checkout -b koha-lxc origin
Branch koha-lxc set up to track remote branch refs/remotes/origin/master.
Switched to a new branch "koha-lxc"

Push lokalnih promjena na drugi git server

Opcionalno dodajte svoj public git repozitorij u koji će se spremati promjene:

koha-lxc:/srv/koha# git remote add koha-dev dpavlin@koha-dev.rot13.org:/srv/koha/

Prvi push mora imati --all parametar da prebaci i novo ime branch-a a ne samo promjene:

koha-lxc:/srv/koha# git push koha-dev --all
dpavlin@koha-dev.rot13.org's password: 
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 339 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To dpavlin@koha-dev.rot13.org:/srv/koha/
 * [new branch]      koha-lxc -> koha-lxc

Debian paketi

dpkg --set-selections < install_misc/debian-lenny.packages
dselect
# Install, Quit

MySQL

U jednom trenutku instalacija će pitati:

New password for the MySQL "root" user:

npr. mysqlroot

Kreirati bazu

koha-lxc:~# mysqladmin -uroot -pmysqlroot create koha

Kreirati korisnika

koha-lxc:~# mysql -uroot -pmysqlroot

mysql> grant all on koha.* to 'kohaadmin'@'localhost' identified by 'katikoan' ;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

Provjerite da se možete povezati sa kohaadmin korisnikom:

koha-lxc:/srv/koha# mysql -h localhost -ukohaadmin -pkatikoan koha

korisnik i grupa

koha-lxc:/srv/koha# addgroup koha
Adding group `koha' (GID 1000) ...
Done.

koha-lxc:/srv/koha# adduser --no-create-home --disabled-login --ingroup koha  --gecos Koha koha
Adding user `koha' ...
Adding new user `koha' (1000) with group `koha' ...
Not creating home directory `/home/koha'.

perl

Debian paketi

koha-lxc:~# apt-get install libgd-gd2-perl libgd-barcode-perl libnumber-format-perl libcache-memcached-perl libparams-util-perl libmodule-install-perl

CPAN

koha-lxc:~# cpan Algorithm::CheckDigits HTTP::OAI IPC::Cmd IPC::Cmd Memoize::Memcached PDF::API2::Simple PDF::Reuse::Barcode PDF::Table SMS::Send Storable Test::More Authen::CAS::Client

Authen::CAS::Client

Trenutna development koha ima bug zbog kojeg je CAS autorizacija po defaultu uključena, pa zahtijeva još nekoliko dodatnih modula

koha-lxc:~# apt-get install libtest-mockobject-perl

koha-lxc:~# cpan Authen::CAS::Client

SAX parser

koha-lxc:/srv/koha# apt-get remove libxml-sax-expat-perl

koha-lxc:/srv/koha# misc/sax_parser_print.pl
Koha wants something like:
    XML::LibXML::SAX::Parser=HASH(0x81fe220)
You have:
    XML::LibXML::SAX::Parser=HASH(0x9858cc0)
Looks good.

Koha install

koha-lxc:/srv/koha# perl Makefile.PL

...

koha-lxc:/srv/koha# make test

...

koha-lxc:/srv/koha# make install
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" fix-perl-path.PL blib

Koha's files have now been installed.

In order to use Koha's command-line batch jobs,
you should set the following environment variables:

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

Apache

ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha

Enable port 8080 for Koha intranet

koha-lxc:/srv/koha# echo 'Listen 8080' > /etc/apache2/conf.d/port-8080.conf

And finish Apache configuration:

koha-lxc:/srv/koha# a2enmod rewrite

koha-lxc:/srv/koha# a2ensite koha

koha-lxc:/srv/koha# /etc/init.d/apache2 restart

Zebra

koha-lxc:/srv/koha# ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon

koha-lxc:/srv/koha# update-rc.d koha-zebra-daemon defaults

koha-lxc:/srv/koha# /etc/init.d/koha-zebra-daemon start

Finish Koha instalation

http://192.168.3.3:8080/

  • login: kohaadmin
  • password: katikoan

from /etc/koha/koha.conf.xml

koha-lxc:/srv/koha# egrep '(user|pass)' /etc/koha/koha-conf.xml | tail -2
 <user>kohaadmin</user>
 <pass>katikoan</pass>