1 =================================================================
2 Installation Guide for Installing Koha
3 on Ubuntu Precise Pangolin (12.04 LTS) with MySQL 5.5
4 =================================================================
6 Copyright (C) 2007, 2008 LibLime (http://liblime.com)
7 Some parts copyright 2010 Chris Nighswonger
8 Some parts copyright 2012 Tomas Cohen Arazi
9 Some parts copyright 2012 Mark Tompsett
11 Original author: Joshua Ferraro
12 Modified for Ubuntu by: Chris Nighswonger
13 (cnighswonger AT foundations DOT edu)
15 More updates by: Tomas Cohen Arazi (tomascohen AT gmail DOT com)
16 Mark Tompsett (mtompset AT hotmail DOT com)
18 Feedback/bug reports: Koha Developer's List:
19 http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
21 This document last modified: 24 July 2012
23 Installation Instructions
24 =================================================================
26 Running commands can mostly be performed as a system user with
27 sudo privileges, however some need to be run directly as root.
29 1. Prepare System and Install Dependencies
31 1.1 Install Ubuntu 12.04 LTS via CD/DVD/USB
33 Download and install Ubuntu from the official site.
34 - Server edition (command-line only)
35 http://www.ubuntu.com/download/server
37 http://www.ubuntu.com/download/desktop
38 To keep your Koha installation minimal and to free resources
39 for running, the Server edition is recommended, though the
40 Desktop edition will work as well.
42 As Apache and MySQL will be installed in the instructions
43 later, there is no need to select any packages during the
44 installation of Ubuntu.
46 1.2 Add koha repository to your apt sources
48 NOTE: This is not required for koha 3.6.7 under Ubuntu 12.04
49 if Zebra indexing (see step 5.2) is done via cron jobs.
50 NOTE: 3.8.x is the recommended current stable release to use.
52 There are currently three active repositories: oldstable,
53 squeeze, and squeeze-dev. As of 2012-07-24, they represent
54 3.6.x, 3.8.x, and master respectively. This will change when
55 3.10.x is released. They will represent 3.8.x, 3.10.x, and
58 It is recommended to use squeeze at this time, as 3.8.x is the
59 current stable release.
62 $ echo "deb http://debian.koha-community.org/koha squeeze main" | sudo tee /etc/apt/sources.list.d/koha-community.list
63 $ wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
64 $ sudo apt-get update ; sudo apt-get upgrade
66 1.3 Install Apache2 and MySQL 5.5
68 Install the Apache2 server:
69 $ sudo apt-get install apache2
71 If your MySQL server will be on your Koha server, or this
72 instruction is confusing:
73 $ sudo apt-get install mysql-server
75 NOTE: You will be prompted to set your root password for MySQL.
77 1.4 Set up your locale
79 Your locale should be set to UTF-8, as should Apache2 and
80 MySQL 5.5. This step is VERY IMPORTANT for a UNICODE compliant
81 system. You _MUST_ be sure to set this BEFORE you install Koha.
85 Verify you have a UTF-8 locale in use:
87 You will recognize if it is UTF-8 or not. Ubuntu 12.04 should
88 not generally require any further steps.
90 If it is not set to something UTF-8, use:
93 You can select one (note that utf8 becomes UTF-8) and use:
94 $ sudo update-locale LANG=en_US.UTF-8
96 You have to log out and back in to see locale change reflected
97 in the locale command.
99 Verify your system local by running the following command:
102 1.4.2 Apache2 and MySQL Locales
103 Please read over the following document carefully for more
105 http://wiki.koha-community.org/wiki/Koha_on_Ubuntu#Configuring_the_Character_Set
109 There are two ways to install Koha. The easy way is using Debian/Ubuntu
110 packages (check http://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_packages
111 for further instructions).
113 The other way is installing from sources. You can get Koha's source
114 either using git (see 1.5.1) or downloading the stable release tarball.
116 1.5.1 Download from Git
119 $ sudo apt-get install git
121 Download Koha (the 3.10.x branch):
122 $ git clone git://git.koha-community.org/koha.git kohaclone
124 $ git checkout -b myinstall origin/3.10.x
126 NOTE: for more information about Git, please see the Koha Git
128 http://wiki.koha-community.org/wiki/Version_Control_Using_Git
130 1.5.2 Download from Tarball
132 You can get the sources from
133 http://download.koha-community.org. Issuing the following
134 command you can get the latest stable release (recommended):
136 Download and Unpack Koha:
137 $ wget http://download.koha-community.org/koha-latest.tar.gz
138 $ tar xvf koha-latest.tar.gz
140 Determine the version and change directory:
142 koha-3.10.00 koha-latest.tar.gz
146 1.6 Install additional Ubuntu dependencies
148 Several Koha dependencies have been conveniently packaged and
149 will be installed issuing the following command:
151 $ sudo apt-get install `cat install_misc/ubuntu.12.04.packages | \
152 cut -f1 | grep -v '#' | grep -v -e '^$'`
154 Confirm that you want to install the required packages when prompted,
156 1.7 Install Perl dependencies that aren't packaged
158 ****************************************************************
159 IMPORTANT: You should only use CPAN for Perl dependencies
160 which are NOT available from the package
161 maintainer. You have been warned!
162 ****************************************************************
164 Run the test script to identify missing libraries
165 $ ./koha_perl_deps.pl -m -u
167 If there are any dependencies which are missing or need
168 upgrading, first attempt aptitude searches:
169 $ aptitude search libbusiness-isdn-perl
171 Notice how the name transformed to 'lib' plus the lowercase
172 library name using '-'s instead of '::'s plus '-perl'. This
173 will generally help find what is missing. And then a simple
174 apt-get install can be done:
175 $ sudo apt-get install libbusiness-isdn-perl
177 Do this for all the dependencies listed. Then re-run the
179 $ ./koha_perl_deps.pl -m -u
181 In general, the repositories on debian.koha-community.org
182 should have any missing pieces. The list should be empty.
184 If any are still listed, they can be installed using the 'cpan'
185 command. If and only if you are unable to find any of the
186 dependencies should you use the cpan command. For example:
187 $ sudo cpan GD GD::Barcode::UPCE Algorithm::CheckDigits
189 NOTE: you may need to run CPAN initialization if you've not run
192 /etc/perl/CPAN/Config.pm initialized.
194 CPAN is the world-wide archive of perl resources. It consists of about
195 100 sites that all replicate the same contents all around the globe.
196 Many countries have at least one CPAN site already. The resources
197 found on CPAN are easily accessible with the CPAN.pm module. If you
198 want to use CPAN.pm, you have to configure it properly.
200 If you do not want to enter a dialog now, you can answer 'no' to this
201 question and I'll try to autoconfigure. (Note: you can revisit this
202 dialog anytime later by typing 'o conf init' at the cpan prompt.)
204 Are you ready for manual configuration? [yes]
206 When the configuration is completed CPAN will install the Perl
207 modules passed on the command-line.
209 For further explanation and reading see:
210 http://wiki.koha-community.org/wiki/Koha_on_Ubuntu#Ubuntu_Packages_for_Perl_Dependencies
213 2. Configuration of dependencies
215 2.1 Update root MySQL password
217 If during the installation of MySQL you were not prompted to
218 set the MySQL password:
219 $ sudo mysqladmin password <password>
221 2.2 Create the Koha database
223 Create the database and user with associated privileges. To do
224 this, decide on the koha database name, the koha user name, and
225 the koha user password. Substitute these into the following
228 Enter mysql root password:
229 Welcome to the MySQL monitor. Commands end with ; or \g.
230 Your MySQL connection id is 42
231 Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
233 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
235 Oracle is a registered trademark of Oracle Corporation and/or its
236 affiliates. Other names may be trademarks of their respective
239 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
241 mysql> CREATE DATABASE {kohadatabasename};
242 mysql> SHOW DATABASES;
243 mysql> CREATE user '{kohauserbasename}'@'localhost' IDENTIFIED by '{kohauserpassword}';
244 mysql> GRANT ALL ON {kohadatabasename}.* TO '{kohausername}'@'localhost' IDENTIFIED BY '{kohauserpassword}';
246 mysql> SELECT host,user FROM user;
247 mysql> DELETE FROM user WHERE user='';
248 mysql> SELECT host,user FROM user;
249 mysql> FLUSH PRIVILEGES;
252 For further explanation of these commands see:
253 http://wiki.koha-community.org/wiki/Koha_on_Ubuntu#Create_MySQL_Database_and_Grant_Privileges
256 2.3 Test your SAX Parser and correct where necessary
258 You must be sure you're using the XML::LibXML SAX parser, not
259 Expat or PurePerl, both of which have outstanding bugs with
260 pre-composed characters. Test your SAX parser by running:
261 $ ./misc/sax_parser_print.pl
263 If your setup is wrong, the script will output something like:
264 Koha wants something like:
265 XML::LibXML::SAX::Parser=HASH(0x81fe220)
267 XML::SAX::Expat=HASH(0x1a94e88)
268 Looks bad, check INSTALL.* documentation.
270 It means you are using Expat (it could also say PurePerl).
271 You'll need to edit your ini file, located at:
272 /etc/perl/XML/SAX/ParserDetails.ini
274 Move the entire section for '[XML::LibXML::SAX::Parser]' to the
275 bottom of the ini file. Then run the script again. The output
276 should look like this:
277 $ misc/sax_parser_print.pl
278 Koha wants something like:
279 XML::LibXML::SAX::Parser=HASH(0x81fe220)
281 XML::LibXML::SAX::Parser=HASH(0x16dfee8)
284 For further details see:
285 http://wiki.koha-community.org/wiki/Koha_on_Ubuntu#Test_to_make_sure_the_SAX_Parser_is_setup_correctly
288 3. Run the Koha installer
290 Add a user for installing koha and running zebra:
293 Build and install Koha:
301 4. Configure and start Apache
303 This will help make koha available to be a website:
304 $ sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
306 NOTE: the path to koha-httpd.conf may be different depending on
307 your installation choices.
309 Make sure you have this lines in /etc/apache2/ports.conf:
314 The default installation of Koha does not use named virtual
315 hosts. If you will not be running named virtual hosts, comment
316 out the following line:
319 Run the following commands:
320 $ sudo a2enmod rewrite deflate
322 $ sudo apache2ctl restart
324 Note: you may still see the usual Apache default site if your
325 VirtualHost configuration isn't correct. The command
326 "sudo a2dissite default" may be a quick fix, but may have
327 side-effects. See the Apache HTTPD manual section on
328 virtual hosts for full instructions.
331 5. Configure and start Zebra
333 This process send responses to search requests sent by Koha or
334 Z39.50/SRU/SRW clients.
336 NOTE: the user you run Zebra as will be the only user with
337 write permission on the Zebra index; in development mode,
338 you may wish to use your system user.
341 5.1 Zebra Search Server
343 Set the zebra daemon to run on start:
344 $ sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
345 $ sudo update-rc.d koha-zebra-daemon defaults
346 $ sudo /etc/init.d/koha-zebra-daemon start
348 NOTE: change the path to koha-zebra-ctl.sh to match your setup
349 if not using the default.
354 There are two ways to do this. ONLY DO ONE! DO NOT DO BOTH!
357 You can configure zebra-indexing as an background daemon, see
358 http://wiki.koha-community.org/wiki/Background_indexing_with_Zebra
362 Add an entry in Koha user crontab to scheduled
363 added/updated/deleted records indexing by Zebra with this
365 <path/to/koha>/misc/migration_tools/rebuild_zebra -z -b -a
367 See check misc/cronjobs/crontab.example for usage examples.
369 NOTE: This job should be setup under the kohauser
370 (the default is 'koha').
373 6. Run the Web Installer, populate the database,
374 initial configuration of settings
376 The hope is that your server is accessible via a nice browser
377 somewhere. If not, install lynx to finish the web install on
379 $ sudo apt-get install lynx
381 Point your browser to http://<servername>:8080/
383 If you installed lynx, and are using defaults, it might be
385 $ lynx http://127.0.1.1:8080/
387 It should redirect you to the Web Installer where you can
388 continue the setup. You can install the sample data for
389 libraries, patrons, etc. via the Web Installer
392 7. Install additional languages
394 In your install directory you can run this commands to have
395 your Koha setup translated to your language:
397 Set your environment variables:
398 $ export KOHA_CONF=/etc/koha/sites/koha/koha-conf.xml
399 $ export PERL5LIB=/usr/share/koha/lib/
401 NOTE: the path to koha-conf.xml may be different depending on
402 your installation choices.
404 Run the translator script:
405 $ cd /usr/share/koha/misc/translator
406 $ perl translate install <language-code>
408 <language-code> must be one of the included in the
409 misc/translator/po directory.
411 NOTE: You can add as many languages as you need. In order to
412 use them you will have to enable them first in the
413 'I18N/L10N' section of the Koha preferences.
418 NOTE: You can use the 'Stage MARC records for import' from the
419 Tools area of Koha's Staff Client to import a batch of
420 MARC records, rather than these instructions.
422 Once the installer has completed, you can import and index MARC
423 records from the command line thusly:
424 $ export KOHA_CONF=/usr/share/koha/etc/koha-conf.xml
425 NOTE: use the correct path to your koha-conf.xml
429 Bibliographic data in MARC21 format:
430 $ misc/migration_tools/bulkmarcimport.pl -file /path/to/marc.iso2709
432 Authority data in MARC21 format:
433 $ misc/migration_tools/bulkauthimport.pl -file /path/to/auth.iso2709
437 NOTE: This script must be run as the kohauser otherwise
438 permission errors and indexing problems will follow.
439 (the default is 'koha' -- see step 3).
441 $ misc/migration_tools/rebuild_zebra.pl -b -w
443 Once the indexing has completed, you will be able to search for
444 records in your system.
447 8.3 Public Z39.50/SRU server
449 To enable public Z39.50/SRU servers, you'll need to edit your
450 koha-conf.xml and change the <listen> options to listen on a
451 TCP port; then restart the zebra daemon.
455 =================================================================
457 If you are running in another language other than English,
458 please switch to English before doing the upgrade, the
459 templating system has changed and the templates will need to be
462 Once you have upgraded, please regenerate your templates in
463 your chosen languages.
466 1. Install new Perl dependencies
468 If you are upgrading from a previous installation of Koha 3.x,
469 you can use the following to identify new Perl dependencies:
470 $ ./koha_perl_deps.pl -u -m
472 Install any missing modules using the instructions on sections
478 $ perl Makefile.PL --prev-install-log /path/to/koha-install-log
486 Koha 3.4.x or later no longer stores items in biblio records so
487 if you are upgrading from an older version as part of the
488 upgrade you will need to do the following two steps, they can
489 take a long time (several hours) to complete for large
491 $ misc/maintenance/remove_items_from_biblioitems.pl --run
492 $ misc/migration_tools/rebuild_zebra.pl -b -r
495 Uninstall Instructions
496 =================================================================
500 Firstly, remove the apache website:
501 $ sudo a2dissite koha
502 $ sudo rm /etc/apache2/sites-available/koha
503 $ sudo apache2ctl restart
505 Next, remove the koha-zebra-daemon:
506 $ sudo update-rc.d koha-zebra-daemon remove
507 $ sudo rm /etc/init.d/koha-zebra-daemon
512 Remember the <kohauser>, <kohapassword, and <kohadatabasename>
513 need to be substituted on the following commands:
514 $ mysql -u<kohauser> -p<kohapassword>
515 mysql> drop database <kohadatabasename>;
520 To help determine what <prefix> should be substituted with,
521 run the following command:
522 $ sudo find / -name "zebra-biblios.cfg"
523 /etc/koha/zebradb/zebra-biblios.cfg
524 /home/user/koha-3.08.03/etc/zebradb/zebra-biblios.cfg
525 /home/user/koha-3.08.03/blib/ZEBRA_CONF_DIR/zebra-biblios.cfg
526 There may be three copies, two of which will likely be in the
527 user account that installed Koha. In this example, our <prefix>
530 Once you know the value of prefix, run these commands
531 substituting in the correct value:
532 $ zebraidx -c <prefix>/zebradb/zebra-biblios.cfg -g iso2709 -d biblios init
533 $ zebraidx -c <prefix>/zebradb/zebra-authorities.cfg -g iso2709 -d authorities init
536 3. Remove Koha Install Directories and Configuration Files
537 Don't forget about any crontab entries
540 Tested on the following operating environments
541 =================================================================
542 - Ubuntu Precise Pangolin 12.04
545 Installer Bug reports
546 =================================================================
547 Please log any installer bug reports at
548 http://bugs.koha-community.org
552 =================================================================
553 This file is part of Koha
555 Koha is free software; you can redistribute it and/or modify it
556 under the terms of the GNU General Public License as published by
557 the Free Software Foundation; either version 2 of the License, or
558 (at your option) any later version.
560 Koha is distributed in the hope that it will be useful, but
561 WITHOUT ANY WARRANTY; without even the implied warranty of
562 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
563 GNU General Public License for more details.
565 You should have received a copy of the GNU General Public License
566 along with Koha; if not, write to the Free Software Foundation:
567 Free Software Foundation
568 51 Franklin Street, Fifth Floor
569 Boston, MA 02110-1301
571 Or visit their website: http://www.fsf.org/