Koha 3.8 on Centos 6.3

From Koha Wiki
Jump to navigation Jump to search
Note.jpg

WARNING! This page is obsolete.
This page is no longer correct and exists for historical reasons only.
Please see Installation Documentation for current information

INSTALLATION

You need to have a server running Perl 5.10 or later, MySQL 5, Zebra 2.0.22 or greater and a webserver (preferably Apache2) before installing Koha.i assume you have installed mysql and perl.

Preparation, bold areas can be copy then pasted on the command line, italized areas need user intervention

MySQL 5: Create a database called 'koha,' owned by 'kohaadmin' user, with a password set. Note: kohaadmin must have at least the following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, and LOCK TABLES.

1. install some prerequisite packages

yum install gdbm-devel perl-Template-Toolkit tcp_wrappers-devel perl-XML-Simple perl-YAML-Syck perl-Test-Deep perl-Test-MockModule perl-Test-Warn perl-Test-YAML-Valid perl-Text-CSV perl-Text-CSV_XS perl-Text-Unaccent perl-Time-Progress perl-UNIVERSAL-require perl-XML-RSS perl-Algorithm-CheckDigits perl-AnyEvent perl-Business-ISBN perl-CGI-Session perl-Cache-Memcached perl-Class-Accessor perl-Readonly-XS perl-PDF-Reuse perl-PDF-API2 perl-DateTime-Format-MySQL perl-DateTime-Format-DateParse perl-DateTime-Format-ICal perl-Number-Format perl-Moose perl-Mail-Sendmail perl-MIME-Lite perl-Locale-PO perl-Locale-Currency-Format perl-Lingua-Stem perl-Lingua-Stem-Snowball perl-JSON perl-HTML-Scrubber GraphicsMagick-perl perl-GD perl-Email-Date perl-Date-Manip perl-Date-Calc perl-Data-ICal perl-DBD-SQLite2 perl-DBD-Mock perl-CPAN perl-CPAN-Meta-YAML gcc libxslt-devel

perl -MCPAN -e shell

o conf build_requires_install_policy yes

o conf prerequisites_policy follow

o conf commit

q

2. install some prerequisite perl modules, some of these maybe found in the package manager but they are outdated.

cpan Authen::CAS::Client AnyEvent::HTTP Biblio::EndnoteStyle CGI::Session::Driver::memcached CGI::Session::Serialize::yaml CHI CHI::Driver::Memcached Cache::Memcached::Fast Data::Pagination Data::Paginator DateTime DateTime::TimeZone GD::Barcode::UPCE Gravatar::URL HTML::FormatText HTTP::OAI JSON::Any MARC::Charset MARC::Crosswalk::DublinCore MARC::File::XML Memoize::Memcached Modern::Perl MooseX::Storage MooseX::Types inc::Module::Install PDF::API2::Simple PDF::Reuse::Barcode PDF::Table SMS::Send Schedule::At String::RewritePrefix Template::Plugin::HtmlToText Test::Strict Text::CSV::Encoded XML::LibXML XML::LibXSLT XML::SAX::ParserFactory Module::Runtime

groupadd koha

useradd -s /bin/false -d /usr/share/koha -g koha -M


3. Get and install koha latest

pushd /tmp

wget http://download.koha-community.org/koha-latest.tar.gz

tar -xzf koha-latest.tar.gz

cd koha-3{tab}

perl Makefile.PL

make

make install


3.2 Koha 3.4.x or later no longer stores items in biblio records. If you are upgrading from an older version you will need to do the following two steps, they can take a long time (several hours) to complete for large databases

misc/maintenance/remove_items_from_biblioitems.pl --run

misc/migration_tools/rebuild_zebra.pl -b -r

popd


4. Profile/Environment settings

echo -e 'setenv KOHA_CONF /etc/koha/koha-conf.xml\nsetenv PERL5LIB /usr/share/koha/lib' > /etc/profile.d/koha.tcsh

echo -e 'export KOHA_CONF=/etc/koha/koha-conf.xml\nexport PERL5LIB=/usr/share/koha/lib' > /etc/profile.d/koha.sh

echo -e '#!/bin/sh\n#\nexport KOHA_CONF=/etc/koha/koha-conf.xml\nexport PERL5LIB=/usr/share/koha/lib\n/usr/share/koha/bin/migration_tools/rebuild_zebra.pl -z -b -w \n' > /usr/share/koha/bin/migration_tools/zebupdate.sh
chmod 755 /usr/share/koha/bin/migration_tools/zebupdate.sh


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

rpm --import http://ftp.indexdata.com/pub/yum/centos/6/RPM-GPG-KEY-indexdata

wget http://ftp.indexdata.com/pub/yum/centos/6/indexdata.repo -P /etc/yum.repos.d/

yum install -y libyaz4 libyaz4-devel bzip2-devel libicu-devel


ln -s /usr/lib64/libyaz.so.4 /usr/lib64/libyaz.so.3


5. install zebra


pushd /tmp

mkdir zebra

cd zebra

wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-modules-2.0.53-1indexdata.x86_64.rpm

wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-devel-2.0.53-1indexdata.x86_64.rpm

wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-2.0.53-1indexdata.x86_64.rpm

wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/idzebra-2.0-2.0.53-1indexdata.x86_64.rpm

rpm -ihv libidzebra-2.0-*

rpm -ihv idzebra-2.0-2.0.53-1indexdata.x86_64.rpm

cd ..

rm -rf zebra

popd


6. Fix koha zebra module path and add service

zebramod=$(find / -name module* | grep -i idzebra) && ls /etc/koha/zebradb/zebra* | xargs perl -pi -e 's#/usr/lib/idzebra-2.0/modules#'$zebramod'#g'

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

ln -s /usr/bin/zebraidx-2.0 /usr/bin/zebraidx
ln -s /usr/bin/zebrasrv-2.0 /usr/bin/zebrasrv

pushd /tmp

wget http://libslack.org/daemon/download/daemon-0.6.4-1.x86_64.rpm
rpm -ihv daemon-0.6.4-1.x86_64.rpm
rm daemon-0.6.4-1.x86_64.rpm

popd

ln -s /usr/local/bin/daemon /usr/bin/daemon

        perl -pi -e 's#ZEBRASRV=/zebrasrv#ZEBRASRV=/usr/bin/zebrasrv#g' /usr/share/koha/bin/koha-zebra-ctl.sh

       chkconfig --add koha-zebra-daemon

service koha-zebra-daemon start

6.2 Add fast index every 2 hours to crontab file then activate it. (optional but recommended for small to semi medium installations during regular catalogue modifications)perl -I/usr/share/koha/lib /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -z -b -a

crontab -l > fastidx.ctab

echo -e '* */2 * * * koha /usr/share/koha/bin/migration_tools/zebupdate.sh \n' >> fastidx.ctab

crontab fastidx.ctab

rm fastidx.ctab