Koha Server class: Xeon proc, 8 gb mem, 2 TB harddisk for 300,000 (3 lacs) books & 20,000 patrons.
- XenServer 要求 64bit，http://www.citrix.com/lang/English/home.asp，或
- VMware exsi 32/64bit 都可以，http://www.vmware.com/
- 4G 以上(每校一個虛擬主機 VM 1G), 三校共4G
- 免螢幕，對 Server來說很少用到
DEEPTI<email@example.com> 2010年12月14日下午2:11 [Koha] MULTIPLE KOHA ON ONE SERVER
To use multiple databases:
A lot of experimentation went into this. You need to modify the /etc/network/interfaces file to bind multiple ip addresses to the ethernet interface. Here is what I wound up with:
- 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.21.249 netmask 255.255.255.0 gateway 192.168.21.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 databases, ours are image, leisure, main.
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.
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.21.139:55180> for the OPAC and <VirtualHost 192.168.21.139:55188> 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 – 55180 and 55188 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 book ( NOT ABLE TO THIS PART AS I THERE IS NO DIR IN /ETC/APACHE2 OF SITES-AVAILABLE)
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.21.239:55280 and you should see the koha opac screen. Browse to the staff client – 192.168.21.239:55288 and you should get that screen. Login as kohaadmin.
For each new database you should create a new library with the IP address that goes with it entered there. Note: 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.
To use a different background on the top bar of the opac for each database, create a new gif file similar to menu-background.gif found in /usr/share/koha/opac/htdocs/opac-tmpl/prog/images with a different name. We have one called green-background.gif in there now. In the /usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css folder create an new css file - we are using imagelib.css. Edit the opac.css file, find the menu-background.gif line. Copy the entire section (Alt-6 in nano). Open the new css file (iamagelib.css) and past the info in (right or left mouse click). Change the menu-background.gif to green-background.gif. Using the staff client – System Preferences – OPAC page change the opaccolorstylesheet option to point to the new css file, imagelib.css in our case. The default is the colors.css file, which is empty. This file overrides the section that is in the opac.css file.
To use a different background for the staff client go to the /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css directory. Copy the intranet.css file to a new name – I used imagelib-intranet.css. Edit the file, and change the fourth line in the file from “background-color:white” to background-color:<something else>”. A list of colors can be found by searching for “css color codes” on Google. You can use the name or maybe the code, didn’t try the code. Move the cursor past the end of the body section marked by a brace and hit Alt-t to delete the rest of the text in the file. Save the file. In the Staff Client go to the System Preferences, Staff Client tab and change the “intranetcolorstylesheet” to the new name. This will change just the background of the pages and use the defaults in the intranet.css file for everything else.
I made the above color changes to try and give the librarian and the users a color cue about what database they were in.
Robin Sheat <firstname.lastname@example.org> Unless you have reason to run them on separate IP addresses, this sounds like serious overkill. You can just create a new DB from within mysql to hold the data of the second one, copy the apache config from the running one, change the location of the koha_conf.xml to one that specifies the different DB and zebra information, change the server names that it responds to, and that should be about it.
I currently have a koha server with 9 completely independent koha setups running on it, all they're really sharing is the code.
Koustubha Kale <email@example.com> And if for some reason you want the code also to be separate, a Dev install works really great..
You create a dev install in each users home directory, create a mysql database, configure Apache for Name / port based virtual servers and you are good to go.