[Koha] Defaulting to a specific branch and Serhold question

Doug Dearden dearden at sarsf.org
Wed Apr 8 09:18:52 NZST 2009


Zachary,

The way I did it was with different virtual hosts listening on different ip address and port combinations, and pointing to the individual databases for each catalog.  One set of koha program files, but a different database and config files for each library.  I have three databases running this way, I'm not sure how it will expand to 17.  My notes on how to do this are pasted below.

Doug



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.

For each new database you should create a new library in the staff client, with the IP address that goes with the library filled in.  DON’T turn on IndependentBranches, it causes other problems and had to be turned off.  It is not needed anyway with the different catalogs running on different virtual servers.

That should get you multiple databases, with appropriate defaults when connecting to the staff client or the opac.


>>> Zachary Spalding <spalding at senylrc.org> 4/6/2009 1:51 PM >>>
I am just starting out with Koha and was hoping someone on the list may be able to answer these questions?

1.  Is there a way to default to a specific branch library,  I have about 17 libraries that our separate institutions that need to default to a search for only their stuff.  If it could be done via a parameter in the URL that would be perfect.  I just don't want to run 17 instances of Koha if I can avoid it.

2.  Has anyone tryed to import Serhold data from National Library of Medicine and can you tell me how did you get that process started with NLM?

Thanks

-- 
Zachary Spalding
Systems Manager
21 S. Elting Corners Rd.
Highland, NY 12528

Phone: 845-883-9065
Fax: 845-883-9483
Email: spalding at senylrc.org 





More information about the Koha mailing list