Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

How To Install BIKA LIMS Inkosi On Ubuntu Server In 15 Minutes


This howto describes how to build a standalone BIKA LIMS solution on top of Ubuntu server. Once you have downloaded and installed the basic Ubuntu the whole process of cutting and pasting takes about 15 minutes.

Since BIKA WILL NOT WORK on new versions of Plone. (Ask them – not me!) This method describes how to get the older WORKING versions of all the software you’ll need and how to install them. A large part of the how to for setting up the Zope/Plone instance was taken from Kees Hink’s script file which I have modified in order for BIKA to work on it and with the latest file locations.

First download and install Ubuntu Hardy Heron 8.04 from the Ubuntu repository. This is the basis for getting the older versions of the software. Since Ubuntu software appears to be linked to the distro this is the distro we want to ensure version compatibility. You can get it from:

http://releases.ubuntu.com/releases/8.04/

We will use LIMSERVER for the name of the computer and USERNAME and PASSWORD where appropriate. Please use your own ones as nessasary. Select openssh and LAMP server using the space bar when requested. Ensure that the LIMSERVER has access to the WWW. and is not locked out by your firewall or something silly.

Once Ubuntu is installed and you have logged in you can  determine the local ip address that was issued by your networks DHCP server to your LIMSERVER by typing

ifconfig

The LIMSERVER local ip is the number following the first instance of inet.

eg inet addr:192.168.2.8 means that the local ip address is 192.168.2.8

(Note: it’s not 127.0.0.1. That’s your loopback address.)

Now go to another computer on your network where you will carry out the remainder of the installation.

Download install and run your favorite tty client on the other computer on your network that you will use to communicate with your LIMS server. I like putty from:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Open an ssh session (port 22) to the local ip address of your LIMSSERVER and log in.

You are now 15 minues away from a working installation of BIKA LIMS. You can copy (using ctrl-c) the command lines and paste them into the SSH session using shift-ins or right click. If multiple lines are shown in a box you can select them all and copy and paste them all at once.

Set up directories for downloading and installing the required software:

DOWNLOAD_DIR=~/temp
BUILDS_DIR=~/builddirs

MY_PRODUCTS_DIR=~/products

Set up the Zope directories:

ZOPE_TARBALLDIR=http://www.zope.org/Products/Zope/2.9.9
ZOPE_TARBALL=Zope-2.9.9-final.tgz
ZOPE_WGET_ADDRESS=$ZOPE_TARBALLDIR/$ZOPE_TARBALL
ZOPE_BUILDDIR=$BUILDS_DIR/Zope-2.9.9-final

 Set up the Plone directories

SOFTWARE_HOME=~/zope-2.9.9
# Plone software
PLONE_TARBALL_DIR=http://launchpad.net/plone/2.5/2.5.3/+download
PLONE_TARBALL=Plone-2.5.3-final.tar.gz
PLONE_VERSION=Plone-2.5.3-final
PLONE_WGET_ADDRESS=$PLONE_TARBALL_DIR/$PLONE_TARBALL
# What do you want your Zope instance to be called?
INSTANCE_HOME=$SOFTWARE_HOME/Plone

Set up the bika directories:

ROOT_LOGIN=’admin’
ROOT_PASSWORD=’PASSWORD’
BIKA_TARBALL_DIR=http://downloads.sourceforge.net/project/bika/bika/2.2.1
BIKA_TARBALL=bika-2_2_1_bundle.tar.gz
BIKA_VERSION=bika-2_2_1_bundle
BIKA_WGET_ADDRESS=$BIKA_TARBALL_DIR/$BIKA_TARBALL
REPORTLAB_TARBALL_DIR=http://www.reportlab.com/ftp/
REPORTLAB_TARBALL=ReportLab_2_4.tar.gz
REPORTLAB_VERSION=ReportLab_2_4
REPORTLAB_WGET_ADDRESS=$REPORTLAB_TARBALL_DIR/$REPORTLAB_TARBALL
BIKAFONTS_ZIPFILE_DIR=http://bioinf.scri.ac.uk/lp/downloads/programs/genomediagram/
BIKAFONTS_ZIPFILE=linfonts.zip
BIKAFONTS_DIR=linfonts
BIKAFONTS_WGET_ADDRESS=$BIKAFONTS_ZIPFILE_DIR/$BIKAFONTS_ZIPFILE

Note you may have to relocate the online sites for the files in the future but it is essential that you get the same versions until the bugs with the later version conflicts are ironed out.

Install the compilers:

sudo apt-get install gcc

sudo apt-get install g++

Create the download directories:

mkdir $BUILDS_DIR $DOWNLOAD_DIR $MY_PRODUCTS_DIR

Install the old version of python:

sudo apt-get install python2.4

sudo apt-get install python2.4-dev

sudo apt-get install python2.4-elementtree

Get Zope off the Internet and install it:

sudo wget $ZOPE_WGET_ADDRESS -P $DOWNLOAD_DIR

sudo tar -xzf $DOWNLOAD_DIR/$ZOPE_TARBALL -C $BUILDS_DIR

cd $ZOPE_BUILDDIR

./configure –prefix=$SOFTWARE_HOME

For an explaination for using “./” in the above line see:

http://www.linfo.org/dot_slash.html

Compile Zope:

sudo apt-get install make

make

make install

Prepare the zope instance:

$SOFTWARE_HOME/bin/mkzopeinstance.py -d $INSTANCE_HOME -u $ROOT_LOGIN:$ROOT_PASSWORD

Download and install Plone:

sudo wget $PLONE_WGET_ADDRESS -P $DOWNLOAD_DIR

sudo tar -xzf $DOWNLOAD_DIR/$PLONE_TARBALL -C $MY_PRODUCTS_DIR

Create your single plone instance (if you create more than one instance you will need to shift up the start-id-server as discussed later).

for i in $MY_PRODUCTS_DIR/$PLONE_VERSION/*;
do echo $i;
ln -s $i $INSTANCE_HOME/Products/;
done

Each line is as read on a single line (4 seperate lines in total).

Since this version of plone doesn’t have all the parts we need we need to install another plone over the top:

sudo apt-get install plone-site

At this point we have a working Plone site installed within a zope instance. The only reason we did it this way with the old versions was because BIKA doesn’t work with the new versions of each. When those bugs are all ironed out I suggest you get Plone up and running with a more modern method. Then carry on from this point onward.

Download and install BIKA LIMS and report lab:

sudo wget $BIKA_WGET_ADDRESS -P $DOWNLOAD_DIR

sudo tar -xzf $DOWNLOAD_DIR/$BIKA_TARBALL -C $MY_PRODUCTS_DIR

sudo wget $REPORTLAB_WGET_ADDRESS -P $DOWNLOAD_DIR

sudo tar -xzvf $DOWNLOAD_DIR/$REPORTLAB_TARBALL -C $MY_PRODUCTS_DIR

Install the version of reportlab associated with Hardy Heron to ensure its proper integration with Ubuntu:

sudo apt-get install python-reportlab

Prepare the directories for the BIKA fonts download and unzip them into the appropriate directory:

sudo mkdir $MY_PRODUCTS_DIR/$BIKAFONTS_DIR

sudo wget $BIKAFONTS_WGET_ADDRESS -P $DOWNLOAD_DIR

sudo cp $DOWNLOAD_DIR/$BIKAFONTS_ZIPFILE $MY_PRODUCTS_DIR/$BIKAFONTS_DIR/$BIKAFONTS_ZIPFILE

sudo apt-get install unzip

cd $MY_PRODUCTS_DIR/$BIKAFONTS_DIR

sudo unzip -j $MY_PRODUCTS_DIR/$BIKAFONTS_DIR/$BIKAFONTS_ZIPFILE

Locate where report lab was installed:

REPORTLAB_INSTALL_LOCATION=`sudo find / -name reportlab -print | grep python2.4`

 Set up a directory to store the bika fonts:

INSTALLED_FONTS_DIR=$REPORTLAB_INSTALL_LOCATION/fonts

sudo mkdir $INSTALLED_FONTS_DIR

sudo cp $MY_PRODUCTS_DIR/$BIKAFONTS_DIR/* $INSTALLED_FONTS_DIR

Show the location of the installed bika fonts and then manually copy it down (or copy to a text file for later select the path of the directory and ctrl-c).

$INSTALLED_FONTS_DIR

e.g.  usr/lib/python2.4/site-packages/reportlab/fonts

Now we need to edit the reportlab config file to show that path to the bika fonts:

sudo nano $REPORTLAB_INSTALL_LOCATION/rl_config.py

This is a text editor program called nano. You can move about the file with the arrow keys and cut and paste whole lines with ctrl-k and ctrl-u respectively.

Find the first line describing the location of the linux adobe fonts, e.g.:

‘/usr/lib/Acrobat9/Resource/Font’,      #Linux, Acrobat 5?

and copy it (cut once and paste twice).

Now edit it it to show the path to the bika fonts which you noted earlier.

e.g.

usr/lib/python2.4/site-packages/reportlab/fonts‘,      #Linux, BIKA fonts

Leave nano by ctrl-x then hit y to save.

Install Bika:

sudo cp $MY_PRODUCTS_DIR/$BIKA_VERSION/PloneProducts/* $INSTANCE_HOME/Products -r

sudo cp $INSTANCE_HOME/Products/bika/scripts/start-id-server $INSTANCE_HOME

Some howtos say you need to edit the start-id-server file (using nano as above for example). Using this howto and having only one client instance of plone you won’t need to. If you have more than one instance of plone you will need a new port number as 8081 may be used by one of the instances.

Now we need to edit the zope.conf file to use the id-server we have set up on 8081.

But first let’s find it:

ZOPECONF_FILE=`sudo find / -name zope.conf -print`

Now let’s edit it in nano like we did with the other config file:

sudo nano $ZOPECONF_FILE

You need to find the environment switch and edit it so it looks exactly as follows:

    <environment>
       IDServerURL http://localhost:8081
    </environment>

Again use ctrl-x and y to exit and save the conf file.

Finally we start the id-server and zope:

su USERNAME $INSTANCE_HOME/start-id-server

$INSTANCE_HOME/bin/zopectl start

Where USERNAME is the username you entered when installing Ubuntu.

BIKA can now be started by opening a browser and going to:

http://LIMSERVERlocalip:8080

Note that LIMSERVERlocalip is the number you discovered when you typed ifconfig at the prompt.

This will take you to the Zope managament interface. To start ip your bika site you need to enter ‘admin’ as the user and locate your password. It’s either the password you’ve been using to date or you’ll have to find it in the zope password file. Try the one you’ve been using and if that doesn’t work go back to the ssh interface and find the password file with

sudo find / -name *password*

Have a look inside using sudo nano.

To start BIKA go to the Zope site interface and hit manage from the zope management interface (ZMI) hit add.

Select Plone site from the drop down menu.

Enter a name for the bika site into the id field, e.g. bika-site-name

Select bika from the plone site options field below and select add.

This will take a while but once it’s done you can get to the BIKA site by going to:

http://LIMSERVERlocalip:8080/bika-site-name

Enjoy!

Comments

comments