Follow up for new translation wrapper
[koha.git] / INSTALL.debian-lenny
blobe6119ab2c4624244ee32a401833c2915862a01aa
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:
26     # Index Data
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
35 1.4 Get Koha
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
41     $ cd 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
51 and get it:
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
66 sources
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 \\
72       Locale::Currency::Format
74 Note: you may need to run CPAN initialization if you've not run cpan
75 before:
77     /etc/perl/CPAN/Config.pm initialized.
78     
79     CPAN is the world-wide archive of perl resources. It consists of about
80     100 sites that all replicate the same contents all around the globe.
81     Many countries have at least one CPAN site already. The resources
82     found on CPAN are easily accessible with the CPAN.pm module. If you
83     want to use CPAN.pm, you have to configure it properly.
84     
85     If you do not want to enter a dialog now, you can answer 'no' to this
86     question and I'll try to autoconfigure. (Note: you can revisit this
87     dialog anytime later by typing 'o conf init' at the cpan prompt.)
88     
89     Are you ready for manual configuration? [yes]
91 When the configuration is completed CPAN will install the Perl modules.
93 2. Configuration of dependencies
95 2.1 Update root MySQL password (if dselect didn't do it for you already)
97     $ sudo mysqladmin password <password>
99 2.2 Create the Koha database
101     Create the database and user with associated privileges:
103     $ mysqladmin -uroot -p<password> create <kohadatabasename>
104     $ mysql -uroot -p<password>
105     
106     Welcome to the MySQL monitor.  Commands end with ; or \g.
107     Your MySQL connection id is 22
108     Server version: 5.0.51a-24 (Debian)
109     
110     Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
111     
112     mysql> grant all on <kohadatabasename>.* to '<kohadatabaseuser>'@'localhost' identified by '<kohadatabaseuserpassword>';
113     Query OK, 0 rows affected (0.00 sec)
115     mysql> flush privileges;
116     Query OK, 0 rows affected (0.00 sec)
118     mysql> quit
120 2.3 Test your SAX Parser and correct where necessary
122 You must be sure you're using the XML::LibXML SAX parser, not Expat or 
123 PurePerl, both of which have outstanding bugs with pre-composed characters. 
124 You can test your SAX parser by running:
126     $ cd koha
127     $ misc/sax_parser_print.pl 
129     You should see something like::
131     XML::LibXML::SAX::Parser=HASH(0x81fe220)
133     If you're using PurePerl or Expat, you'll need to edit your
134     ini file, typically located at:
136     /etc/perl/XML/SAX/ParserDetails.ini
139 3. Run the Koha installer
141     $ perl Makefile.PL
142     ( answer questions )
143     $ make
144     $ make test
145     $ sudo make install
147 4. Configure and start Apache
148     $ sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
149     (note that the path to koha-httpd.conf may be different depending on your
150     installation choices)
152 Add the following lines to /etc/apache2/ports.conf:
154     Listen 80
155     Listen 8080
157 Run the following commands:
159     $ sudo a2enmod rewrite
160     $ sudo a2ensite koha
161     $ sudo apache2ctl restart
163 Note: you may still see the usual Apache default site if your VirtualHost
164 configuration isn't correct.  The command "sudo a2dissite default" may be a
165 quick fix, but may have side-effects.  See the Apache HTTPD manual section on
166 virtual hosts for full instructions.
168 5. Configure and start Zebra
170 Note: it's recommended that you daemonize the Zebra process and add it to your
171 startup profile. For a non-production test/development installation, running 
172 Zebra from the command line can be useful. Pick from the two available options
173 below, or roll your own :-)
175 Note: it's also recommended that you create a Koha system user, which you will
176 have specified during the install process. Alternatively, Zebra can be
177 configured to run as the root user.
179 Option 1: run the Zebra processes from the command line:
181 1.1 Zebra Search Server
183 This process send responses to search requests sent by Koha or
184 Z39.50/SRU/SRW clients.
186     $ sudo -u ${KOHA_USER} zebrasrv -f /etc/koha/koha-conf.xml
187     (note that the path to koha-conf.xml may be different depending on your
188     installation choices)
190 Note: the user you run Zebra as will be the only user with write permission
191       on the Zebra index; in development mode, you may wish to use your
192       system user.
194 1.2 Zebra Indexer
196 Added/updated/deleted records in Koha MySQL database must be indexed
197 into Zebra. A specific script must be launched each time a bibliographic
198 or an authority record is edited.
200     $ sudo -u ${KOHA_USER} misc/migration_tools/rebuild_zebra -z -b -a
202     Note: if you are running in this mode, you may wish to defer starting the
203     zebraqueue until you've run the web installer (see below).
205 Option 2: run automatically Zebra processes as daemons:
207 Note that references to $SCRIPT_DIR refer to the directory where
208 Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
210 1.1 Zebra Search Server
212     $ sudo ln -s ${SCRIPT_DIR}/koha-zebra-ctl.sh  /etc/init.d/koha-zebra-daemon
213     (Note: ${SCRIPT_DIR} is /usr/share/koha/bin/ by default in a standard install)
214     $ sudo update-rc.d koha-zebra-daemon defaults
215     ( Note: see man chkconfig(8) on other distros )
216     
217     $ sudo ${SCRIPT_DIR}/koha-zebra-ctl.sh start
219 1.2 Zebra Indexer
221 Add an entry in Koha user crontab to scheduled added/updated/deleted records
222 indexing by Zebra with this command:
224   <path/to/koha>/misc/migration_tools/rebuild_zebra -z -b -a
226 See check misc/cronjobs/crontab.example for usage examples.
228 6. Run the Web Installer, populate the database, initial configuration of settings
230     Point your browser to http://<servername>:8080/
232     It should redirect you to the Web Installer where you can continue the setup.
233     You can install the sample data for libraries, patrons, etc. via the Web Installer
235 7. What next?
237     Once the installer has completed, you can import and index MARC records from the
238     command line thusly (Note: you can also use the 'Stage MARC records for import' from
239     the Tools area of Koha's Staff Client to import a batch of MARC records):
241     $ export KOHA_CONF=/usr/share/koha/etc/koha-conf.xml
242       (note: use the correct path to your koha-conf.xml)
244 7.1 Import:
246 Bibliographic data in MARC21 format
248     $ misc/migration-tools/bulkmarcimport.pl -file /path/to/marc.iso2709
250 Authority data in MARC21 format
252     $ misc/migration-tools/bulkmarcimport.pl -a -file /path/to/auth.iso2709
254 7.2 Fast Index:
255     $ misc/migration-tools/rebuild_zebra.pl -b -w
257     Once the indexing has completed, you will be able to search for records in your
258     system. NOTE: if you don't run the Fast Index utility, and you have the index
259         updates scheduled as per 7.3 the indexing process will happen in the background,
260         but it will be orders of magnitude slower.
262 7.3 Schedule regular index updates
263     run rebuild_zebra.pl -b -a -z as a regular cron job, 
264     check misc/cronjobs/crontab.example for usage examples
265     
266 7.4 To enable public Z39.50/SRU servers, you'll need to edit your koha-conf.xml and
267     change the <listen> options to listen on a TCP port; then restart the zebra daemon.
269 UPGRADE
270 =======
271 If you are upgrading from a previous installation of Koha 3, you can
272 use the following:
274  perl Makefile.PL --prev-install-log /path/to/koha-install-log
275  make
276  make test
277  sudo make upgrade
279 Uninstall Instructions
280 =============================
281 1) Stop Services:
282    $ sudo a2dissite koha
283    $ sudo rm /etc/apache2/sites-available/koha
284    $ sudo apache2ctl restart
286    $ sudo update-rc.d koha-zebra-daemon remove
287    $ sudo rm /etc/init.d/koha-zebra-daemon
289 2) Remove Database and Indexes
291    # MySQL
292    $ mysql -u<kohauser> -p<kohapassword>
293    > drop database koha;
295    # Zebra Indexes
296    $ zebraidx -c <prefix>/etc/zebradb/zebra-biblios.cfg -g iso2709 -d biblios init
297    $ zebraidx -c <prefix>/etc/zebradb/zebra-authorities.cfg -g iso2709 -d authorities init
299 3) Remove Koha Install Directories and Configuration Files
300    Don't forget about any crontab entries
302 Tested on the following operating environments
303 ==============================================
304 - Debian Lenny 5.0
306 Other Notes
307 =====================
308 This file is part of Koha
310 Koha is free software; you can redistribute it and/or modify it under the
311 terms of the GNU General Public License as published by the Free Software
312 Foundation; either version 2 of the License, or (at your option) any later
313 version.
315 Koha is distributed in the hope that it will be useful, but WITHOUT ANY
316 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
317 A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
318 You should have received a copy of the GNU General Public License along with
319 Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
320 Suite 330, Boston, MA  02111-1307 USA