1 =============================
2 Installation Guide for Installing Koha on Debian Lenny with MySQL 5
3 =============================
5 Feedback/bug reports: Koha Developer's List:
6 http://lists.koha.org/mailman/listinfo/koha-devel
8 This document last modified: 19 December 2009
10 Installation Instructions
11 =============================
13 All commands can be performed as a system user with sudo privileges,
14 as indicated or by running the command directly as root.
16 1. Prepare System and Install Dependencies
18 1.1 Install Debian Lenny via Businesscard CD
20 See http://www.debian.org/releases/lenny/debian-installer/
22 1.3 Set up Indexdata apt sources for Yaz and Zebra packages
24 Edit your /etc/apt/sources.list file and add the following:
27 deb http://ftp.indexdata.dk/debian lenny main
28 deb-src http://ftp.indexdata.dk/debian lenny main
30 The Index Data packages are signed with a key you can install as follows:
32 $ wget http://ftp.indexdata.dk/debian/indexdata.asc
33 $ sudo apt-key add indexdata.asc
37 1.4.1 Option A: Download Koha via Git (optional)
39 $ sudo apt-get install git-core git-email
40 $ git clone git://git.koha.org/pub/scm/koha.git kohaclone
42 $ git checkout -b myinstall origin
44 Note: for more information about Git, please see the Koha Git Usage Guide:
46 http://wiki.koha.org/doku.php?id=en:development:git_usage
48 1.4.2 Option B: Download Koha from http://download.koha.org
50 Find the latest Koha stable version on http://download.koha.org
53 $ wget <URL> found on download.koha.org
55 1.5 Install additional Debian dependencies
57 IMPORTANT: You should only use CPAN for Perl dependencies which are NOT
58 available from the package maintainer. You have been warned!
60 Run shell script installing all necessary Debian packages, MySQL Server,
61 Zebra and all Debian packaged Perl module required by Koha:
63 $ sudo install_misc/apt-get-debian-lenny.sh
65 1.6 Install Perl dependencies that aren't packaged into Debian Lenny
68 Run the following command:
70 $ sudo cpan Algorithm::CheckDigits SMS::Send HTTP::OAI IPC::Cmd \\
71 Memoize::Memcached PDF::API2::Simple PDF::Table Storable Test::More
73 Note: you may need to run CPAN initialization if you've not run cpan
76 /etc/perl/CPAN/Config.pm initialized.
78 CPAN is the world-wide archive of perl resources. It consists of about
79 100 sites that all replicate the same contents all around the globe.
80 Many countries have at least one CPAN site already. The resources
81 found on CPAN are easily accessible with the CPAN.pm module. If you
82 want to use CPAN.pm, you have to configure it properly.
84 If you do not want to enter a dialog now, you can answer 'no' to this
85 question and I'll try to autoconfigure. (Note: you can revisit this
86 dialog anytime later by typing 'o conf init' at the cpan prompt.)
88 Are you ready for manual configuration? [yes]
90 When the configuration is completed CPAN will install the Perl modules.
92 2. Configuration of dependencies
94 2.1 Update root MySQL password (if dselect didn't do it for you already)
96 $ sudo mysqladmin password <password>
98 2.2 Create the Koha database
100 Create the database and user with associated privileges:
102 $ mysqladmin -uroot -p<password> create <kohadatabasename>
103 $ mysql -uroot -p<password>
105 Welcome to the MySQL monitor. Commands end with ; or \g.
106 Your MySQL connection id is 22
107 Server version: 5.0.51a-24 (Debian)
109 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
111 mysql> grant all on <kohadatabasename>.* to '<kohadatabaseuser>'@'localhost' identified by '<kohadatabaseuserpassword>';
112 Query OK, 0 rows affected (0.00 sec)
114 mysql> flush privileges;
115 Query OK, 0 rows affected (0.00 sec)
119 2.3 Test your SAX Parser and correct where necessary
121 You must be sure you're using the XML::LibXML SAX parser, not Expat or
122 PurePerl, both of which have outstanding bugs with pre-composed characters.
123 You can test your SAX parser by running:
126 $ misc/sax_parser_print.pl
128 You should see something like::
130 XML::LibXML::SAX::Parser=HASH(0x81fe220)
132 If you're using PurePerl or Expat, you'll need to edit your
133 ini file, typically located at:
135 /etc/perl/XML/SAX/ParserDetails.ini
138 3. Run the Koha installer
146 4. Configure and start Apache
147 $ sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
148 (note that the path to koha-httpd.conf may be different depending on your
149 installation choices)
151 Add the following lines to /etc/apache2/ports.conf:
156 Run the following commands:
158 $ sudo a2enmod rewrite
160 $ sudo apache2ctl restart
162 Note: you may still see the usual Apache default site if your VirtualHost
163 configuration isn't correct. The command "sudo a2dissite default" may be a
164 quick fix, but may have side-effects. See the Apache HTTPD manual section on
165 virtual hosts for full instructions.
167 5. Configure and start Zebra
169 Note: it's recommended that you daemonize the Zebra process and add it to your
170 startup profile. For a non-production test/development installation, running
171 Zebra from the command line can be useful. Pick from the two available options
172 below, or roll your own :-)
174 Note: it's also recommended that you create a Koha system user, which you will
175 have specified during the install process. Alternatively, Zebra can be
176 configured to run as the root user.
178 Option 1: run the Zebra processes from the command line:
180 1.1 Zebra Search Server
182 This process send responses to search requests sent by Koha or
183 Z39.50/SRU/SRW clients.
185 $ sudo -u ${KOHA_USER} zebrasrv -f /etc/koha/koha-conf.xml
186 (note that the path to koha-conf.xml may be different depending on your
187 installation choices)
189 Note: the user you run Zebra as will be the only user with write permission
190 on the Zebra index; in development mode, you may wish to use your
195 Added/updated/deleted records in Koha MySQL database must be indexed
196 into Zebra. A specific script must be launched each time a bibliographic
197 or an authority record is edited.
199 $ sudo -u ${KOHA_USER} misc/migration_tools/rebuild_zebra -z -b -a
201 Note: if you are running in this mode, you may wish to defer starting the
202 zebraqueue until you've run the web installer (see below).
204 Option 2: run automatically Zebra processes as daemons:
206 Note that references to $SCRIPT_DIR refer to the directory where
207 Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
209 1.1 Zebra Search Server
211 $ sudo ln -s ${SCRIPT_DIR}/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
212 (Note: ${SCRIPT_DIR} is /usr/share/koha/bin/ by default in a standard install)
213 $ sudo update-rc.d koha-zebra-daemon defaults
214 ( Note: see man chkconfig(8) on other distros )
216 $ sudo ${SCRIPT_DIR}/koha-zebra-ctl.sh start
220 Add an entry in Koha user crontab to scheduled added/updated/deleted records
221 indexing by Zebra with this command:
223 <path/to/koha>/misc/migration_tools/rebuild_zebra -z -b -a
225 See check misc/cronjobs/crontab.example for usage examples.
227 6. Run the Web Installer, populate the database, initial configuration of settings
229 Point your browser to http://<servername>:8080/
231 It should redirect you to the Web Installer where you can continue the setup.
232 You can install the sample data for libraries, patrons, etc. via the Web Installer
236 Once the installer has completed, you can import and index MARC records from the
237 command line thusly (Note: you can also use the 'Stage MARC records for import' from
238 the Tools area of Koha's Staff Client to import a batch of MARC records):
240 $ export KOHA_CONF=/usr/share/koha/etc/koha-conf.xml
241 (note: use the correct path to your koha-conf.xml)
245 Bibliographic data in MARC21 format
247 $ misc/migration-tools/bulkmarcimport.pl -file /path/to/marc.iso2709
249 Authority data in MARC21 format
251 $ misc/migration-tools/bulkmarcimport.pl -a -file /path/to/auth.iso2709
254 $ misc/migration-tools/rebuild_zebra.pl -b -w
256 Once the indexing has completed, you will be able to search for records in your
257 system. NOTE: if you don't run the Fast Index utility, and you have the index
258 updates scheduled as per 7.3 the indexing process will happen in the background,
259 but it will be orders of magnitude slower.
261 7.3 Schedule regular index updates
262 run rebuild_zebra.pl -b -a -z as a regular cron job,
263 check misc/cronjobs/crontab.example for usage examples
265 7.4 To enable public Z39.50/SRU servers, you'll need to edit your koha-conf.xml and
266 change the <listen> options to listen on a TCP port; then restart the zebra daemon.
270 If you are upgrading from a previous installation of Koha 3, you can
273 perl Makefile.PL --prev-install-log /path/to/koha-install-log
278 Uninstall Instructions
279 =============================
281 $ sudo a2dissite koha
282 $ sudo rm /etc/apache2/sites-available/koha
283 $ sudo apache2ctl restart
285 $ sudo update-rc.d koha-zebra-daemon remove
286 $ sudo rm /etc/init.d/koha-zebra-daemon
288 2) Remove Database and Indexes
291 $ mysql -u<kohauser> -p<kohapassword>
292 > drop database koha;
295 $ zebraidx -c <prefix>/etc/zebradb/zebra-biblios.cfg -g iso2709 -d biblios init
296 $ zebraidx -c <prefix>/etc/zebradb/zebra-authorities.cfg -g iso2709 -d authorities init
298 3) Remove Koha Install Directories and Configuration Files
299 Don't forget about any crontab entries
301 Tested on the following operating environments
302 ==============================================
306 =====================
307 This file is part of Koha
309 Koha is free software; you can redistribute it and/or modify it under the
310 terms of the GNU General Public License as published by the Free Software
311 Foundation; either version 2 of the License, or (at your option) any later
314 Koha is distributed in the hope that it will be useful, but WITHOUT ANY
315 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
316 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
317 You should have received a copy of the GNU General Public License along with
318 Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
319 Suite 330, Boston, MA 02111-1307 USA