[Koha] For multiple Database for koha to run in zebra server

mohan pradhan pradhmohan at gmail.com
Thu Apr 23 18:20:20 NZST 2009


Dear all,

I want to run the koha for two different databases in two different ip
addresses in the same computer. I have two databases already which are
"koha" and "book"  and also two different xml and httpd-conf files for
the same. Here, I can add the marc records into the second database
"book" having configuration files as "book-conf.xml" and
"book-httpd.conf"; which is also shown in mysql for the newly added
biblio, but the problem is when i run the zebra server and try to
search the added catalogue from the staff client, it doesnot show. It
is showing the records from the first database "koha" only  while it
has to be shown from second database "book" instead. How can i run
zebra server for two different databases "koha" and "book" addressed
at two different ip addresses in the same computer.

The procedure that i have done are mentioned below in detail.




To use multiple databases:

Modify the /etc/network/interfaces file to bind multiple ip addresses
to the ethernet interface.  After much trial and error I wound up with
this:

--------------------------------------------------------------------------------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth1 eth1:0 eth1:1
iface lo inet loopback


# The primary network interface
allow-hotplug eth1
iface eth1 inet static
   address 192.168.1.133
   netmask 255.255.255.0
   gateway 192.168.1.10

iface eth1:0 inet static
   address 192.168.1.139
   netmask 255.255.255.0
   gateway 192.168.21.10

iface eth1:1 inet static
   address 192.168.1.140
   netmask 255.255.255.0
   gateway 192.168.1.10

------------------------------------------------------------------------------------------------------

This creates three static addresses on the same interface eth1.

Using phpmyadmin or the MySQL command line, login as kohaadmin and
create the new database.

You need to dump the structure of the koha database and then import it
into the new databases.  To dump the database use mysqldump .  At the
command line, create a new directory and cd into it.  Then enter:

mysqldump -u kohaadmin -p koha > kohaout.sql

You enter the password for kohaadmin, and this creates an sql file of
the koha database.

Create the new databases using phpmyadmin or the mysql command line -
example below.  Start the mysql command line utility with:

mysql -u kohaadmin -p

After you enter your password, this gives you a mysql prompt.  Then enter:

show databases;  to see the list of databases.  To create one enter:
create database <new db name>;

Then change to that dataabase:
use <new DB name>;

This command will import all the koha structure into the new database:

source  kohaout.sql;

quit gets you out of the MySql utility and back to the command line.

Next you copy the config files.  Change to the /etc/koha directory,
and copy the koha-conf.xml and koha-httpd-conf files using the new
name of your database.  So if your database is named "book", you now
have book-conf.xml and book-httpd.conf.  Edit the book-conf.xml file,
and change the name of the database.  You should find this near the
end of the file under the <config> section.  Edit the book-httpd.conf
file and make the following changes:

Edit the VirtualHost entry and change the name to one of the IP
addresses you bound to the network interface - using a different
address for each configuration/database.  So your entry looks like
<VirtualHost 192.168.1.139:50180> for the OPAC and <VirtualHost
192.168.1.139:50188> for the staff client.  The IP addresses need to
be in the interfaces config file, and the ports (after the :) are from
the address range 50000 - 63535.  These are unassigned ports in the
internet scheme, and since they will be used only on the internal
network can be whatever you like.  The normal koha ports are the
standard http port 80 for the OPAC and 8080 for the staff client.
Further down in each VirtualHost section find the SetEnv KOHA_CONF
declaration.  Change the file to the new one, in our example
"/etc/koha/book-conf.xml".  You need to change this in two places, one
for each VirtualHost section.

Change to the /etc/apache2 directory and edit the ports.conf file.
Add the new ports you just put into the VirtualHost directives  50180
and 50188 in our example.  If you want to use the default koha
database, also add 8080 - the default staff client port.

You need to add symbolic links for the httpd.conf file and enable the
site, so as above you do:

ln -s /etc/koha/book-httpd.conf  /etc/apache2/sites-available/book
a2ensite koha

Then restart Apache - /etc/init.d/apache2 reload
If you have done all your edits correctly, apache will reload without
any errors.

Browse to the new IP address - i.e. 192.168.1.139:50180 and you should
see the koha opac screen.  Browse to the staff client -
192.168.21.139:50188 and you should get that screen.  Login as
kohaadmin.


with regards,
Mohan Raj Pradhan
HEALTHNET NEPAL
KATHMANDU, NEPAL


More information about the Koha mailing list