Monday, January 9, 2012

Koha installation on Ubuntu 12.04

Install Ubuntu /Xubuntu 12.04 LTS

Open a terminal and apply following commands,

sudo su
apt-get install leafpad

Add Koha package repository


wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
echo deb http://debian.koha-community.org/koha squeeze main | sudo tee /etc/apt/sources.list.d/koha.list

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install koha-common

Initial Configuration

Create a new file

leafpad
/etc/koha/koha-sites.conf

Add the following lines and save.


DOMAIN=".yourdomain.org"  # Change this to be your domain. Any instance will be a subdomain of this string.
INTRAPORT="8000" # TCP listening port for the administration interface
INTRAPREFIX="" # For administration interface URL: Prefix to be added to the instance name.
INTRASUFFIX="-intra" # For administration interface URL: Suffix to be added to the instance name.
DEFAULTSQL="" # a value is generally not needed.
OPACPORT="8001" # TCP listening port for the users' interface (if you skip this, the apache default of 80 will be used)
OPACPREFIX="" # For users' interface URL: Prefix to be added to the instance name.
OPACSUFFIX="" # For users' interface URL: Suffix to be added to the instance name.
ZEBRA_MARC_FORMAT="marc21" # Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'
ZEBRA_LANGUAGE="en" # Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'

Adding ports

Open following file and add ports

sudo leafpad /etc/apache2/ports.conf

Add two ports for Koha


Listen 8000
Listen 8001
 
Apply following commands,

sudo a2enmod rewrite

Configuration of  UTF-8 in MySQL and Apache
Enable UTF-8 at MySQL
Open a Terminal and type following command,


sudo su 
leafpad /etc/mysql/my.cnf  

[Under the Basic settings section, add the following,]
 
# UTF-8 Defaults for Koha
init-connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci

leafpad /etc/apache2/conf.d/charset
[Add the following two lines in]
 
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8

Save the file and close the editor.

Sax parser setup

leafpad /etc/perl/XML/SAX/ParserDetails.ini

Cut and paste the following command to the bottom of the file and save it.

[XML::LibXML::SAX::Parser]
http://xml.org/sax/features/namespaces=1



Instance creation
sudo apt-get install mysql-server

[Put a password for MySQL Root USER]

Apply following commands,
 
sudo apt-get clean
sudo koha-create --create-db library

Ubuntu MySQL security Tweak

sudo su
mysql -u root -p

[Enter the MySQL Root password when it ask]
Execute the following commands,

USE mysql;
SELECT host,user FROM user;
DELETE FROM user WHERE user=''; SELECT host,user FROM user;
FLUSH PRIVILEGES;
QUIT

Configuring Apache
Execute the following commands in a terminal. 

sudo a2dissite 000-default
sudo a2enmod rewrite
sudo a2enmod deflate
sudo a2ensite library
sudo /etc/init.d/apache2 restart

Start web installation of Koha
The username to log in with will be koha_library and the password will be near the end of /etc/koha/sites/library/koha-conf.xml
Apply the following command to see the koha login password,

sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml

Open following link,

http://127.0.1.1:8000  

Zebra rebuild command

sudo su
koha-rebuild-zebra -v -f library

Reference

http://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_packages#Enable_Modules_and_Site
 

0 comments:

Post a Comment