Book Image

Koha 3 Library Management System

Book Image

Koha 3 Library Management System

Overview of this book

Koha is the first full-featured open source library management system that is widely used for efficiently managing libraries. However, setting up and maintaining Koha is no walk in the park. It is not as straightforward as setting up the other popular LAMP applications.This practical guide provides all the essential information that is needed to make the task of installing and configuring Koha really seem simple and easy. It demonstrates how to set up Koha and its various aspects – installation, configuration, application administration, and data migration. It also covers troubleshooting, software maintenance, software customization, and other advanced topics.The book starts with installing and configuring the LAMP stack and the Koha application to meet your needs. It then goes deeper into setting up various rules and configuring settings for Koha. It also covers data migration of catalog records, software maintenance, and customization of the application. Chapters are also dedicated to providing an insight into advanced topics such as LDAP integration and Internationalization. Filled with numerous code samples and screenshots, this book will tour you through setting up Koha for evaluation or test purposes. It also includes loads of tips for troubleshooting and maintenance activities. By the end of this book, you will have gained the knowledge to get the most out of your Koha installation.
Table of Contents (19 chapters)
Koha 3 Library Management System
Credits
About the Authors
About the Reviewers
Preface
Index

Installing Koha's software stack


In this final section we demonstrate the installation steps on Debian and openSUSE.

Installing packages using the package manager

We will install most packages using the package manager. Having installed Git in an earlier section, readers are already familiar with the commands used to install individual packages; in this section, we also look at ways of speeding up the process.

Installing packages from the Linux prompt

You can install the packages one-by-one like this:

koha@li190-245:~/kohaclone> sudo apt-get install apache2

On openSuSE, the command would look like this:

koha@li190-245:~/kohaclone> sudo yast -i apache2

Or you can install multiple packages in one statement:

koha@li190-245:~/kohaclone> sudo apt-get install apache2 mysql make gcc

Or:

koha@li190-245:~/kohaclone> sudo yast -i apache2 mysql make gcc

Installing packages using shell scripts

To speed up the installation, you can write a shell script file that looks like this:

yast -i apache2 \
mysql \
make \
gcc \
yaz \
libyaz \
libyaz-devel \
perl-Algorithm-CheckDigits \
perl-Biblio-EndnoteStyle \

And execute this script using the sh command:

koha@li190-245:~> sudo sh yast-opensuse-perl.sh

Installing packages using dselect

Debian and Ubuntu users can use dselect, a convenient way to install package lists.

First we install dselect:

koha@li190-245:~/kohaclone$ sudo apt-get install dselect

Next, we select what needs to be installed by pointing to the file containing the list of packages:

koha@li190-245:~/kohaclone$ sudo dpkg --set-selections < install_misc/debian.packages

Finally we install the selected packages:

koha@li190-245:~/kohaclone$ sudo dselect

From the dselect screen, we will need to execute the install, configure, and delete options in sequence.

Installing Perl modules using CPAN

We use the CPAN shell to install only those Perl modules that are not available in your distribution's sources.

We can install such modules from inside the CPAN shell, like this:

koha@li190-245:~/kohaclone$ sudo cpan
cpan[1]> install HTTP::OAI

Install multiple modules using a single statement:

cpan[2]> install IPC::Cmd Net::LDAP Net::LDAP::Filter 
Net::Z3950::ZOOM Text::CSV::Encoded

Another way of doing it is from the Linux shell:

koha@li190-245:~> sudo cpan HTTP::OAI

Here is how we install modules from the Linux shell:

koha@li190-245:~> sudo cpan IPC::Cmd Net::LDAP Net::LDAP::Filter 
Net::Z3950::ZOOM Text::CSV::Encoded

Troubleshooting CPAN installations

If CPAN modules don't install successfully, we would see messages like these at the end of install command:

MIRK/Net-Z3950-ZOOM-1.26.tar.gz              : writemakefile NO
'/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512
 WRW/Barcode-Code128-2.01.tar.gz              : make_test NO
 LARSLUND/PDF-Reuse-Barcode-0.05.tar.gz       : make_test NO one
dependency not OK (Barcode::Code128)
cpan[8]>

From the messages above, we learn that the module Net-Z3950-ZOOM has failed at the Makefile.PL stage likely due to missing prerequisites.

The module PDF-Reuse-Barcode has failed to install, because one of its prerequisites—Barcode::Code128 has failed at the make test stage.

To troubleshoot such problems we need to look at error messages for clues. Resolve any problems that are found and then install each module manually using the make set of commands.

As an example, let us troubleshoot problems with installing the module Net-Z3950-ZOOM.

We use the look command to get into a Linux subshell:

cpan[8]> look Net::Z3950::ZOOM
Running look for module 'Net::Z3950::ZOOM'
Trying to open a subshell in the build directory...
Working directory is /home/koha/.cpan/build/Net-Z3950-ZOOM-1.26-C9NuSo

We run make clean to start afresh:

sh-3.2# make clean
make: *** No rule to make target 'clean'.  Stop.

Next run the Makefile.PL program:

sh-3.2# perl Makefile.PL

At this stage we see an error message indicating missing system packages:

ERROR: Unable to call script: yaz-config
If you are using a YAZ installation from the Debian package "yaz", you
will also need to install "libyaz-dev" in order to build this module.

This means we need to install YAZ related packages using the package manager, on Debian—yaz and libyaz-dev and on openSUSE—yaz, libyaz, libyaz-devel.

After installing these packages using the package manager, we run the make series of commands to complete the installation:

cpan[8]> look Net::Z3950::ZOOM
sh-3.2# make clean
sh-3.2# perl Makefile.PL
sh-3.2# make
sh-3.2# make test
sh-3.2# make install
sh-3.2# exit
cpan[8]> 

Setting up Koha's MySQL database

Before we install Koha, we need to setup Koha's MySQL database and a MySQL user with privileges over the database.

Unless you have already done this as part of the installation, we first secure MySQL by configuring a password for the root users:

koha@li190-245:linux:/home/koha # mysqladmin -u root password 'yourdbrootpasswd';

Log in to MySQL using root:

koha@li190-245:~/kohaclone$ mysql -u root -pEnter password:

Create Koha's database:

mysql> create database koha;

Create a MySQL user for Koha's database and grant it privileges. Both actions are accomplished with one command:

mysql> grant all on koha.* to 'kohaadmin'@'localhost' identified by 'katikoan';
mysql> flush privileges;
mysql> quit

Configuring Koha's installation: Makefile.PL

After we have installed required system and Perl packages and set up the database, we are ready to install Koha. The first step is to run Makefile.PL to configure Koha's installation. We will need to supply responses to questions such as mode of installation or database name:

koha@linux:/home/koha/kohaclone # perl Makefile.PL 

Enter responses to configuration questions as follows:

Installation mode should be dev if you wish to use Git to apply patches.

Installation mode (dev, single, standard) [standard] dev 

User koha must have write access to the configuration directory to avoid permissions problems:

Configuration directory: [/home/koha/koha-dev] 
 

Choosing mysql, Postgre support in Koha is experimental:

DBMS to use (Pg, mysql) [mysql]
 

Here we specify the name of the database we created in an earlier step:

Please specify the name of the database to be used by Koha [koha] 

Specify the MySQL user that has privileges over the database; we created this user in an earlier step:

Please specify the user that owns the database to be used by Koha [kohaadmin] 

Specify the password of this user:

Please specify the password of the user that owns the database to be used by Koha [katikoan] katikoan

Say yes to Zebra – Koha's powerful catalog search engine; Although Koha can function without Zebra by using database indexes, Zebra's superior capabilities make it an important part of your installation:

Install the Zebra configuration files? (no, yes) [yes] 

For other questions, the default value should be fine. Simply press the Return key to proceed to the next step.

The program display a summary of the configuration at the end, make a note of the details:

Koha will be installed with the following configuration parameters: 
DB_HOST  localhost 
DB_NAME  koha 
DB_PASS  katikoan 
DB_PORT  3306 
DB_TYPE  mysql 
DB_USER  kohaadmin 
INSTALL_BASE  /home/koha/koha-dev 
INSTALL_MODE dev 
INSTALL_ZEBRA  yes 
KOHA_INSTALLED_VERSION  3.01.00.124 
RUN_DATABASE_TESTS   no 
USE_MEMCACHED  no 

If you have installed all prerequisites you should not see warning messages of missing prerequisites. If you do, you should go back and install any missing modules. Rerun Makefile.PL till all warnings disappear.

Completing Koha's installation

Run the following commands to complete the installation of Koha:

koha@li190-245:~/kohaclone$ make
koha@li190-245:~/kohaclone$ make test
koha@li190-245:~/kohaclone$ sudo make install