Koha on Debian Lenny + Squeeze mixed HOWTO

From Koha.org:

Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, it is currently maintained by a team of software providers and library technology staff from around the globe.

This HOWTO will guide you though Koha 3.0.x installation on Debian Lenny + Squeeze mixed environment (Why in Debian mixed but not stable only? Well... This is my normal procedure with 3rd party tarball package...)

Install Debian Lenny

What does "Debian Lenny + Squeeze mixed" means? This means the Debian will install with Lenny (stable), plus Squeeze/sid APT source (testing/unstable), where "pin" and install targeted packages as testing only. I love this model more than normal installation. This is my style and you may not follow.

So first of all, install your Debian with Lenny netinst/CD/DVD. We will define hostname as koha.example.com within this HOWTO:

koha_debian_squeeze-001.pngkoha_debian_squeeze-001.png

Setup root password as katikoan (This is the default admin password of koha installation, so we reuse it in here):

koha_debian_squeeze-002.pngkoha_debian_squeeze-002.png

Create a normal user named as koha with password koha (optional). This will be used as daemon user for koha:

koha_debian_squeeze-003.pngkoha_debian_squeeze-003.png

We only need Standard system for koha installation. Any other else are optional:

koha_debian_squeeze-004.pngkoha_debian_squeeze-004.png

Now just complete the rest of Debian installation as usual. Reboot it and go to next step.

Post-configuration after first reboot

Let's install some useful packages before any else:

apt-get update
apt-get install vim openssh-server rsync

Check and edit your system hostname from /etc/hostname as below:

koha.example.com

Check and edit your hosts file /etc/hosts with below information:

127.0.0.1       localhost.localdomain           localhost
127.0.0.1       koha.example.com                koha

Completely update your Debian installation as up-to-date (if you have define some network APT sources):

aptitude update && aptitude -y full-upgrade && aptitude autoclean && aptitude clean

Reboot and check if everything looks good.

Add Squeeze and other APT sources

Edit and update your /etc/apt/sources.list as below (The source from Index Data are required for Yaz and Zebra):

# This should be added by "apt-cdrom add". Delete it if not suitable.
deb cdrom:[Debian GNU/Linux 5.0.3 _Lenny_ - Official i386 DVD Binary-1 20090905-08:48]/ lenny contrib main

# We will need both stable and testing source.
deb http://ftp.hk.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.hk.debian.org/debian/ stable main contrib non-free
deb http://ftp.jp.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ stable main contrib non-free
deb http://ftp.us.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stable main contrib non-free

deb http://ftp.hk.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.hk.debian.org/debian/ testing main contrib non-free
deb http://ftp.jp.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ testing main contrib non-free
deb http://ftp.us.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free

deb http://volatile.debian.org/debian-volatile stable/volatile main contrib non-free
deb-src http://volatile.debian.org/debian-volatile stable/volatile main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free

# Index Data for Yaz and Zebra.
deb http://ftp.indexdata.dk/debian lenny main
deb-src http://ftp.indexdata.dk/debian lenny main

# Source below are optional. Just add them if you understand what they are.
deb http://ftp.hk.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.hk.debian.org/debian/ unstable main contrib non-free
deb http://ftp.jp.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ unstable main contrib non-free
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

deb http://ftp.hk.debian.org/debian/ experimental main contrib non-free
deb-src http://ftp.hk.debian.org/debian/ experimental main contrib non-free
deb http://ftp.jp.debian.org/debian/ experimental main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ experimental main contrib non-free
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free
deb-src http://ftp.us.debian.org/debian/ experimental main contrib non-free

deb http://jonas.genannt.name/debian lenny restricted
deb http://download.webmin.com/download/repository sarge contrib
deb http://download.virtualbox.org/virtualbox/debian lenny non-free

Create and edit /etc/apt/preferences as below, which "pin" your Debian on stable:

Package: *
Pin: release a=stable
Pin-Priority: 700

Package: *
Pin: release a=testing
Pin-Priority: 650

Package: *
Pin: release a=unstable
Pin-Priority: 600

Package: *
Pin: release a=experimental
Pin-Priority: 550

Don't forget to download keys from Index Data:

Run the update once again and check if any missing:

aptitude update && aptitude -y full-upgrade && aptitude autoclean && aptitude clean

Install required libraries and packages

I am a bit lazy and so summarize all required packages into debian-squeeze.packages.txt. It is mainly coming from official install_misc/debian-lenny.packages and suggestion from Installing Koha 3 On Ubuntu Hardy Heron (8.04, LTS), with fine tune and update for Debian Squeeze. Download debian-squeeze.packages.txt and run the following commands:

wget http://edin.no-ip.com/files/debian-squeeze.packages.txt -O debian-squeeze.packages
dpkg --set-selections < debian-squeeze.packages
aptitude -t testing

Resolve any else conflict within aptitude (most likely accept ALL required upgrade for broken packages) and install all of them.

Now, something are still missing and we will need to install from CPAN manually (that why I would like to install with Lenny + Squeeze mixed: most packages are already included, unlink that of standard Lenny or Ubuntu 8.04):

cpan HTTP::OAI

NOTE: Once you run perl Makefile.PL during installation (which will mention later), it may report that some libraries or packages are still missing. Come back to this section and complete the missing.

Prepare MySQL locale and database

During package installation MySQL will ask for admin password. Whatever you answered let's update it as katikoan for simpler management:

mysqladmin password katikoan -p

Next, edit /etc/mysql/my.cnf, add and modify your setup as below:

[mysqld]
#
# * Basic Settings
#

# UTF-8 Defaults for Koha
init-connect    = 'SET NAMES utf8'
character-set-server    = utf8
collation-server        = utf8_general_ci

Restart MySQL in order to make it active:

/etc/init.d/mysql restart

Create database and user for Koha:

mysqladmin -uroot create koha -p
echo "grant all on koha.* to 'kohaadmin'@'localhost' identified by 'katikoan';" | mysql -uroot -p
mysqladmin -uroot -p flush-privileges

Install Koha

Download the lastest stable from http://download.koha.org/ (don't trust http://koha.org/download, information is outdated...), e.g. koha-3.00.04.tar.gz at this moment:

cd /usr/local/src
wget http://download.koha.org/koha-3.00.04.tar.gz
tar
zxf koha-3.00.04.tar.gz
cd /usr/local/src/koha-3.00.04

Now process the Makefile.pl. It will ask you a lot of question, BUT, JUST KEEP ON PRESSING ENTER AND ACCEPT ALL DEFAULT VALUE (that why we setup all user's password as katikoan as simplified). You may only hope to change them if you understand it:

perl Makefile.PL

Well, if nothing missing, we may now compile Koha:

make
make test

NOTE: You may receive some errors during the make test complaining about an “Illegal Date” … they can safely be ignored.

Install it if looks fine:

make install

Configure and start Apache

Copy VirtualHost setup for Koha (NOTE: You may update it as <VirtualHost *:80> and <VirtualHost *:8080> if you still see the usual Apache default site; also run a2dissite default if required)

cp /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha

Add the following lines to /etc/apache2/ports.conf:

Listen 80
Listen 8080

Complete the rest of tasks:

a2enmod rewrite
a2ensite koha
/etc/init.d/apache2 restart

Configure and start Zebra

Here we will run Zebra as daemons, and add to startup process:

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

Run the web installer

Nothing special, just browse your site with http://localhost:8080/ and follow the rest of installation.

Once web installer complete, you may log into Koha admin interface with username kohaadmin with password katikoan

For OPAC interface you can now access with http://localhost/

What's next?

In order to find items using the Zebra interface, you will have to schedule indexing. If you bulk imported bibliographic records, you will want to run a “Fast Index” first. This is done by entering the following command:

perl -I /usr/share/koha/lib /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -v -b -w

You should also refer to INSTALL.debian-lenny and figure out any missing procedure after "Step 6. Run the Web Installer, populate the database, initial configuration of settings"

AttachmentSize
debian-squeeze.packages.txt5.02 KB

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <p> <br> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup> <acronym> <pre> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.