Features Library System
Total Page:16
File Type:pdf, Size:1020Kb
FEATURES Library System David Maska, 123RF Maska, David Easy library administration with Koha Book Keeper Information technology plays a key role in modern library In this article, I describe Koha and, more environments. We check out Koha, an open source specifically, the configuration of Koha 3.02 on a 64-bit openSUSE [2] server. integrated system that can help manage a library’s daily Initial Configuration operations. By Evelthon Prodromou Installing Koha on your server is quite easy. The first thing you should do is in- ibrary catalogs were originally by both patrons and staff through an in- stall the required packages: Apache web based on a card system that was tuitive web interface. server [3], some Perl modules, and the tedious and time-consuming to The setup is a pilot system for second- MySQL [4] database. Start by opening a Lupdate. Fortunately, this task is ary schools in Cyprus. Three lyceums console and issuing: now done by modern electronic systems are currently participating in this effort, for easy central administration of li- and the Library of the University of Cy- yast -i apache2 apache2-mod-perlU brary catalogs. Recently, I had the plea- prus is helping with setup, fine-tuning, mysql-community-server make gcc sure of installing one such system, and hosting the project. Koha. Koha [1] is an open source inte- For the initial test bed, I imported the After installing these packages, you need grated library system initially developed library’s catalog from another system to to tune the system locale, Apache, and by Katipo Communications Ltd. in New Koha. The next step was to import the MySQL. Your system’s locale must be Zealand. Cyprus Union Catalog to Koha (planned UTF-8. To see whether this is the case, The Koha system includes modules for for the near future). The union catalog circulation, cataloging, acquisitions, seri- includes bibliographic data from 38 dif- LISTING 1: System Locale als, reserves, patron (user) management, ferent libraries across the island, with locale and more. Koha uses the well-known more than half a million records, which LANG=en_US.UTF-8 MySQL database and is easily accessible will give a major boost to the project. LC_CTYPE="en_US.UTF-8" For example, a school library will no LC_NUMERIC="en_US.UTF-8" AUTHOR longer need to catalog its books be- LC_TIME="en_US.UTF-8" cause most of them will be in the union LC_COLLATE="en_US.UTF-8" Evelthon Prodromou is catalog. LC_MONETARY="en_US.UTF-8" an electrical and com- LC_MESSAGES="en_US.UTF-8" puter engineer. He is cur- Additionally, the solution will benefit LC_PAPER="en_US.UTF-8" rently working as IT Offi- everyone participating in the school LC_NAME="en_US.UTF-8" cer at the Library of the union catalog. One installation serves an LC_ADDRESS="en_US.UTF-8" University of Cyprus. His interests in- arbitrary number of libraries through LC_TELEPHONE="en_US.UTF-8" clude server virtualization, ranking algo- web-based access, with no locally in- LC_MEASUREMENT="en_US.UTF-8" rithms, e-learning, and human-computer stalled clients. This system will require LC_IDENTIFICATION="en_US.UTF-8" interaction. You can view his personal fewer support hours and will be easier to LC_ALL= website at http://www.prodromou.eu. maintain and update. 56 AUGUST 2011 ISSUE 129 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM 056-062_Koha.indd 56 7/1/11 1:27:57 PM FEATURES Library System go to a shell console and type locale. enable or disable The output should look like Listing 1. If Apache modules LISTING 2: MySQL Variable Set Values your system is not already in UTF-8, you and other param- 01 mysql> show variables like 'char%'; can follow the procedure in the “Setting eters of the web 02 +--------------------------+----------------------------+ Locale to UTF-8” box. server. 03 | Variable_name | Value | To download Koha, issue 04 +--------------------------+----------------------------+ MySQL 05 | character_set_client | utf8 | 06 | character_set_connection | utf8 | wget http://download.koha-community.U Config 07 | character_set_database | utf8 | org/koha-version.tar.gz If you get this far, MySQL is already 08 | character_set_filesystem | binary | and extract it with tar, installed. So, you 09 | character_set_results | utf8 | need to make sure 10 | character_set_server | utf8 | 11 | character_set_system | utf8 | tar xvfz koha-version.tar.gz it starts on boot, turns on, and 12 | character_sets_dir | /usr/share/mysql/charsets/ | 13 +--------------------------+----------------------------+ which goes into folder koha‑version. takes care of secu- 14 8 rows in set (0.00 sec) rity: Apache Configuration The next step is to set Apache encoding. chkconfig mysql on Koha ships with a shell utility that you To set default encoding to UTF-8, create rcmysql start can use for this: a local configuration file and add the /usr/bin/mysql_secure_installation Add DefaultCharset directive: koha_root_folder/misc/sax_parser_print.pl The last command tightens security and vi /etc/apache2/httpd.conf.local allows you to remove the test databases In my case, Koha’s SAX parser checker and the anonymous user account created returned the contents of Listing 4. Add the following to the file: by default. This step is strongly recom- As it says in line 5, it looks bad, but mended for production servers. Apart fixing this error is easy: You just need to AddDefaultCharset UTF-8 from setting a root password, the rest of locate a file called ParserDetails.ini as the questions are better left to their de- follows: and save. Next, enter: fault values by simply pressing Enter. Now make sure the My SQL encoding find / -iname ParserDetails.ini a2enmod perl5 is set to UTF-8. To change it, go to a chkconfig apache2 on MySQL prompt with mysql ‑p, answer You will get a reply like: rcapache2 restart the challenge by entering the root pass- word, then check the encoding settings /usr/lib/perl5/vendor_perl/5.12.1/XML/U The preceding commands enable Perl as in Listing 2 with show. In this case, all SAX/ParserDetails.ini scripting, restart Apache, and make sure settings are in UTF-8, so no changes are it starts on boot. necessary. The next step is to edit ParserDetails. The last step for MySQL is to grant ini and change [XML::SAX::PurePerl] to Configuring Apache privileges to the Koha user for the Koha [XML:: LibXML:: SAX:: Parser] and save. To I set up the system on openSUSE, which database. You can do this through the verify, rerun sax_parser_print.pl. You uses the YaST configuration tool. The MySQL command interface. On success- should get a Looks good message (List- basic steps for other distros are similar, ful creation of the database, you need to ing 5). but the details will differ. On openSUSE create a My SQL user and grant that user systems, use YaST to install the yast2- the necessary privileges for Koha’s data- Installing Perl Modules http package, which offers a GUI tool for base. In the case described in this article, When you are finished with the XML easy HTTP server management. After in- the MySQL user is called kohaadmin parser, you need to install a few Perl stalling this package, reload YaST and go (Listing 3). modules. To discover which, execute to Network Services | http server. Make perl Makefile.PL. sure the HTTP server is allowed through SAX Parser At this point, I had hoped I would be the firewall. From this tool, you can also Koha is primarily built on Perl, so you greeted by some sort of installation mes- need to make sure the perl-XML-SAX sage, but I was not. Instead, I got a com- SETTING LOCALE TO UTF-8 and perl-XML-LibXML packages are in- plaint from the installer saying Can’t lo- stalled. If not, you can install them from cate ZOOM.pm in @INC (@INC con- 1. Load YaST. a shell prompt: tains:. 2. Go to System | Languages. Further investigation in Makefile.PL 3. Click on Details. A new window ap- pears. Make sure Locale settings for yast -i perl-XML-SAX perl-XML-LibXML showed that I was missing the perl-Net- User root is set to yes and the Use Z3950-ZOOM package. This package is UTF-8 Encoding checkbox is checked. Next, you need to check which XML not located in the standard openSUSE re- 4. Accept your changes. parser your system is using. Fortunately, positories (those added when the system LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 129 AUGUST 2011 57 056-062_Koha.indd 57 7/1/11 1:28:00 PM FEATURES Library System sc11.supercomputing.org Conference firsts: storage and analysis across a LISTING 3: MySQL User Creation and Setup LISTING 4: Parser Checker • a full day of technical diverse range of science and mysql -u root -p 01 Koha wants something like: sessions on Friday, engineering disciplines. Enter password: 02 XML::LibXML::SAX::Parser=HASH( November 18, the last day 0x81fe220) Welcome to the MySQL monitor. Commands end with ; or \g. 03 You have: • the most Technical Your MySQL connection id is 53 04 XML::SAX::PurePerl=HASH(0x9a2bd0) Program submissions ever SC11 will continue to recog- Server version: 5.1.53-log SUSE MySQL RPM Seattle, WA 05 Looks bad, check INSTALL.* • a State of the Practice track nize exceptional individual documentation. Connecting communities Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. through HPC • a Scientific Visualization accomplishments through This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you Showcase the awards and fellowship are welcome to modify and redistribute it under the GPL v2 license LISTING 5: Verifying Parser November 12-18, 2011 • the largest number of programs. The Communities 01 misc/sax_parser_print.pl exhibitors ever—nearly 300 Program offers opportunities Type 'help;' or '\h' for help.