Installing Koha on OpenBSD

If my general instructions on this topic are insufficient then you should probably not be attempting this yet. Spend some time reading the documentation and getting comfortable with both OpenBSD and Koha. A good place to start is the OpenBSD FAQ and the Koha Installation section. Please note that I’ve downloaded some stuff to my local ftp server since it usually takes a few tries to figure things out. You will have to modify the source server in the example commands.

My general methodology:

  1. Install OpenBSD.
  2. Apache 1.3.29 + patches + security enhancements is part of the default install. Install MySQL from packages system.
  3. Download, extract, and install Koha. The installer will tell you what you need.
  4. Install prerequisites from OpenBSD packages if they exist and are new enough for Koha, otherwise use CPAN or compile source code.
  5. Install Koha.

Koha 2.2.8

Setup Packages/Ports

For details, refer to the OpenBSD FAQ

export PKG_PATH=ftp://172.16.1.10/pub/OpenBSD/$(uname –r)/packages/$(machine -a)/:ftp://mirror.arcticnetwork.ca/pub/OpenBSD/$(uname –r)/packages/$(machine -a)/:http://gulus.USherbrooke.ca/pub/distro/OpenBSD/$(uname –r)/packages/$(machine -a)/

Install and setup MySQL

Koha 2.2.8 is the first release officially combpatible with MySQL 5. However there is still one change required in koha.mysql before Koha will install and a couple error messages still appear. MySQL 5 is the only version available via the OpenBSD package system so if you want MySQL 4.x you're on your own. You’ll probably want to modify some default MySQL settings and setup rc.local so that MySQL is started automatically. I found the MySQL 5 Installation and Setup guide useful.

pkg_add -iv mysql-server
/usr/local/bin/mysqld_safe &
/usr/local/bin/mysqladmin -u root password 'yourpassword'
/usr/local/bin/mysqladmin -u root -p -h $(hostname) password 'yourpassword'

Compile, and install Yaz

Yaz is not available as a package for OpenBSD so you will need to grab the source code from http://www.indexdata.dk/yaz/ and compile it. I’ve found that versions newer than 2.1.8 create a problem with Koha’s installer. For more details see http://lists.katipo.co.nz/public/koha/2006/009583.html and http://bugzilla.indexdata.dk/show_bug.cgi?id=979. The problem is caused by YAZ using threads and PERL not using threads but can workaround by compiling Yaz without threads. But unfourtunately there's some broken code in Yaz 2.1.54 that has to be fixed in order to do that.

Yaz requires a few packages.

pkg_add –iv libiconv bison libxml libxslt

Get and extract Yaz.

cd /tmp && ftp ftp://172.16.1.10/pub/yaz/yaz-2.1.54.tar.gz 
tar xvzf yaz-2.1.54.tar.gz && cd /tmp/yaz-2.1.54

Modify the section that declares the “tid” variable in the yaz_strftime() function of /src/log.c

vi ./src/log.c
#ifdef WIN32
        DWORD tid = GetCurrentThreadId();
#elifdef YAZ_POSIX_THREADS
        pthread_t tid = pthread_self();
#elifdef YAZ_GNU_THREADS
        pthread_t tid = 0;
#else
        int tid = 0;
#endif

Compile Yaz without threads and specify where to find iconv

./configure --with-iconv=/usr/local --disable-threads
make && make install

Install Remaining Prerequisites

Install the remaining components neccesary for Koha. There is some dependency between components, specifically:

  • MARC:Charset requires p5-Class-Accessor, maybe MARC::Record too
  • MARC::File::XML requires MARC::Charset
  • ZOOM requires MARC::Record
pkg_add -iv p5-URI p5-Compress-Zlib p5-HTML-Parser p5-DateManip p5-HTML-Template p5-XML-Simple p5-Date-Calc p5-Class-Accessor
perl -MCPAN -e 'install "LWP::Simple"'
perl -MCPAN -e 'install "Mail::Sendmail"'
perl -MCPAN -e 'install "MARC::Record"'
perl -MCPAN -e 'install "MARC::Charset"'
perl -MCPAN -e 'install "MARC::File::XML"'
perl -MCPAN -e 'install "ZOOM"'

(Optional) Install Barcode Components

If you have a default OpenBSD install you will need to add the Xbase40 file set for p5-GD-Barcode. You can either use the install media and choose the upgrade option or do the following:

cd /
ftp ftp://172.16.1.10/pub/OpenBSD/4.0/i386/xbase40.tgz 
tar xzvpf xbase40.tgz

Now install the barcode components

pkg_add –iv p5-PDF-Reuse p5-GD-Barcode
perl -MCPAN -e 'install "PDF::API2"'
perl -MCPAN -e 'install "Data::Random"'
perl -MCPAN -e 'install "Barcode::Code128"'
perl -MCPAN -e 'install "PDF::Reuse::Barcode"'

(Optional) Install LDAP Components

If you want to authenticate your patrons using LDAP then you at least need to install Net::LDAP. I don't use LDAP so you're on your own again.

perl -MCPAN -e 'install "Net::LDAP"'

Install Koha

If you’re using MySQL 5 you need to make some changes in koha.mysql first. Find the word return and change it to `return`. For reference see http://lists.katipo.co.nz/public/koha/2006/010269.html and http://lists.katipo.co.nz/public/koha/2006/010318.html. You’ll likely get an error about invalid default values but this doesn’t appear to be significant http://lists.katipo.co.nz/public/koha/2006/010318.html

I usually install Koha to the /var/www in the hopes that I may eventually get it running properly chrooted in Apache.

cd /tmp && ftp ftp://172.16.1.10/pub/koha/koha-2.2.8.tar.gz && tar xvzf koha-2.2.8.tar.gz
cd /tmp/koha-2.2.8
export prefix=/var/www
vi koha.mysql		#`return` keyword
perl installer.pl

Setup apache

Add the following to /var/www/conf/httpd.conf

Include /etc/koha-httpd.conf

Edit /etc/koha-httpd.conf and uncomment the Listen directive for ports 80 and 8080.

Start Apache with

httpd -u

And you should now have a funtional Koha installed.

Koha 2.2.6RC2

The release notes indicated that the following new perl modules are required:

  • Class::Accessor (0.25)
  • XML::SAX (0.14)
  • MARC::File::XML (0.83),
  • MARC::Charset (0.95),
  • LWP::Simple
  • XML::Simple

In addition I've found that Date::Calc is also required even though the installer does not indicate so.

Setup Packages/Ports

For details, refer to the OpenBSD FAQ

export PKG_PATH=ftp://mirror.arcticnetwork.ca/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/:ftp://ftp.ca.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/

Install and setup MySQL

You’ll probably want to modify rc.local so that MySQL is started when the computer boots.

pkg_add -iv mysql-server
/usr/local/bin/mysqld_safe &
/usr/local/bin/mysqladmin -u root password 'yourpassword'

Compile, and install Yaz

Yaz is not available as a package for OpenBSD so you will need to grab the source code from http://www.indexdata.dk/yaz/ and compile it. I’ve found that versions newer than 2.1.8 create a problem with Koha’s installer. For more details see http://lists.katipo.co.nz/public/koha/2006/009583.html. I’ve tried the following later versions with problems: 2.1.10, 2.1.18, and 2.1.24.

cd /tmp && ftp ftp://172.16.1.10/pub/yaz/yaz-2.1.8.tar.gz 
tar xvzf yaz-2.1.8.tar.gz && cd /tmp/yaz-2.1.8
./configure && make && make install

Install Remaining Prerequisites

(Optional) Install PDF::API2 Ver 0.3r77

As of writing this document, an older version of PDF::API2 is required for barcode generation so don’t install it from CPAN.

cd /tmp && ftp ftp://172.16.1.10/pub/perl/PDF-API2-0.3r77.tar.gz
tar xvzf PDF-API2-0.3r77.tar.gz && cd /tmp/PDF-API2-0.3r77
perl Makefile.PL && make && make install

Install from Packages

pkg_add –v p5-Compress-Zlib-1.41
pkg_add –v p5-XML-Simple-2.14		#cpan ver fails make test
pkg_add –v p5-HTML-Template-2.6		#cpan ver is 2.8
pkg_add –v p5-DateManip-5.42a		#cpan ver is 5.44
pkg_add –v p5-Date-Calc-5.4

#pkg_add –v p5-Class-Accessor-0.22 #before MARC::Charset – CPAN V0.25

Install from CPAN

Do not install PDF::API2 from CPAN. Koha requires version 0.3r77. I've found that I have to install Net::LDAP twice unless Convert::ASN1 is installed first. Class::Accessor must also be installed prior to MARC::Record.

perl -MCPAN -e 'install "Class::Accessor"'
perl -MCPAN -e 'install "MARC::Record"'
perl -MCPAN -e 'install "MARC::Charset"'
perl -MCPAN -e 'install "MARC::File::XML"'
perl -MCPAN -e 'install "LWP::Simple"'
perl -MCPAN -e 'install Event'
perl -MCPAN -e 'install Net::Z3950'
perl -MCPAN -e 'install "Mail::Sendmail"'
perl -MCPAN -e 'install "Convert::ASN1"'
perl -MCPAN -e 'install "Net::LDAP"'

You may need to upgrade the XML::SAX module using CPAN. I noticed no problems with version 0.12 installed from packages however.

perl -MCPAN -e 'install "XML::SAX"'

Install Koha

If you’re using MySQL 5 you need to make some changes in koha.mysql first. http://lists.katipo.co.nz/public/koha/2006/010269.html http://lists.katipo.co.nz/public/koha/2006/010318.html

cd /tmp && ftp ftp://172.16.1.10/pub/koha/koha-2.2.6RC2.tar.gz && tar xvzf koha-2.2.6RC2.tar.gz
cd /tmp/koha-2.2.6RC2 && perl installer.pl

I usually install Koha to the following locations:

/var/www/koha/opac
/var/www/koha/intranet
/var/www/koha/log

Setup apache

Add the following to /var/www/conf/httpd.conf

Include /etc/koha-httpd.conf

Edit /etc/koha-httpd.conf and uncomment the Listen directives.

Koha 2.2.5

Setup Packages/Ports

For details, refer to the OpenBSD FAQ

export PKG_PATH=ftp://mirror.arcticnetwork.ca/pub/OpenBSD/$(uname –r)/packages/$(machine -a)/:ftp://ftp.ca.openbsd.org/pub/OpenBSD/$(uname –r)/packages/$(machine -a)/

Install and setup MySQL

You’ll probably want to modify rc.local so that MySQL is started when the computer boots.

pkg_add -iv mysql-server
/usr/local/bin/mysqld_safe &
/usr/local/bin/mysqladmin -u root password 'yourpassword'

Compile, and install Yaz

Yaz is not available as a package for OpenBSD so you will need to grab the source code from http://www.indexdata.dk/yaz/ and compile it. I’ve found that versions newer than 2.1.8 create a problem with Koha’s installer. For more details see http://lists.katipo.co.nz/public/koha/2006/009583.html. I’ve tried the following later versions with problems: 2.1.10, 2.1.18, and 2.1.24.

cd /tmp && ftp ftp://172.16.1.10/pub/yaz/yaz-2.1.8.tar.gz 
tar xvzf yaz-2.1.8.tar.gz && cd /tmp/yaz-2.1.8
./configure && make && make install

Install Remaining Prerequisites

(Optional) Install PDF::API2 Ver 0.3r77

As of writing this document, an older version of PDF::API2 is required for barcode generation so don’t install it from CPAN.

cd /tmp && ftp ftp://172.16.1.10/pub/perl/PDF-API2-0.3r77.tar.gz
tar xvzf PDF-API2-0.3r77.tar.gz && cd /tmp/PDF-API2-0.3r77
perl Makefile.PL && make && make install

Install from CPAN

Do not install PDF::API2 from CPAN. Koha requires version 0.3r77. I've found that I have to install Net::LDAP twice unless Convert::ASN1 is installed first.

perl -MCPAN -e 'install "MARC::Record"'
perl -MCPAN -e 'install Event'
perl -MCPAN -e 'install Net::Z3950'
perl -MCPAN -e 'install Digest::MD5'
perl -MCPAN -e 'install "HTML::Template"'
perl -MCPAN -e 'install "Mail::Sendmail"'
perl -MCPAN -e 'install "Date::Manip"'
perl -MCPAN -e 'install "Convert::ASN1"'
perl -MCPAN -e 'install "Compress::Zlib"'
perl -MCPAN -e 'install "Net::LDAP"'

Koha Install

If you’re using MySQL 5 you need to make some changes in koha.mysql first. http://lists.katipo.co.nz/public/koha/2006/010269.html http://lists.katipo.co.nz/public/koha/2006/010318.html

cd /tmp && ftp ftp://172.16.1.10/pub/koha/koha-2.2.6RC2.tar.gz && tar xvzf koha-2.2.6RC2.tar.gz
cd /tmp/koha-2.2.6RC2 && perl installer.pl

I usually install Koha to the following locations:

/var/www/koha/opac
/var/www/koha/intranet
/var/www/koha/log

Setup apache

Add the following to /var/www/conf/httpd.conf

Include /etc/koha-httpd.conf

Edit /etc/koha-httpd.conf and uncomment the Listen directives.

 
openbsd.txt · Last modified: 2007/04/05 18:11 by mdalgity
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki