Menu

Guide

Laboratório de Biodados

BOWS

User guide for BOWS installation and usage

Authors:

  • Henrique Velloso
  • J Miguel Ortega

1. Introduction

2. Installation

2.1. Requirements

Before downloading and installing BOWS, make sure that your computer or server fulfills the following requirements:

  • UNIX platform;
  • MySQL;
  • Java;
  • Apache Tomcat.

2.1.1. MySQL

BOWS requires MySQL. If you are not familiar on how installing MySQL in a UNIX platform, follow these steps:
If you're using Fedora, CentOS or RedHat, type this command to download and install MySQL:

> su -c "yum install mysql mysql-server"

In case you’re using Debian or Ubuntu, use this command:

> sudo apt-get install mysql mysql-server

After the installation, type these commands to configure your MySQL appropriately:

> chkconfig  mysqld on
> mysql_install_db
> service mysqld start

Then, create an administrator account (usually referred as root) and a password for it by typing:

> mysqladmin -u root password [yourpassword]

Now you are able to access the administrator account of your MySQL with the username “root” and password “[yourpassword]” by typing in the Terminal:

> mysql -u root -p

Log in as root to create a new user called "bows" and grant permissions to create databases by typing the commands:

mysql> CREATE USER 'bows'@'localhost' IDENTIFIED BY 'bows123';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'bows'@'localhost';

This user account is required by BOWS (see 2.3. Creating and configuring BOWS database).

2.1.2. Java

The main code of MaLe-PSI-BLAST was developed in Java (v.1.6.0). To install Java in your computer, type on Terminal the following command line according to your Unix distribution:
Debian, Ubuntu, etc.

> sudo apt-get install openjdk-7-jre

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

> su -c "yum install java-1.7.0-openjdk"

2.1.3. Apache Tomcat

To install Tomcat you simple extract the archive and start the tomcat server. Tomcat by default start on port 8080. To allow access in this port edit iptables. Log in as root, then type:

> vi /etc/sysconfig/iptables

Add this line above the "-A INPUT -j REJECT" lines: (press key "i" to edit) -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
You should have something like this:

:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4:464]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

To close and save alterations press "Esc" then ":x!"
After that restart iptables, typing the command:

> /etc/init.d/iptables restart

We recommend install Apache Tomcat into /usr/local/ folder, to do this log in as root typing in the Terminal:

> su

Then go to directory /usr/local by typing in the Terminal:

> cd /usr/local/

After that download Apache Tomcat7 typing:

> wget http://ftp.unicamp.br/pub/apache/tomcat/tomcat-7/v7.0.53/bin/apache-tomcat-7.0.53.tar.gz

Decompress the file typing the following command:

> tar xvzf apache-tomcat-7.0.53.tar.gz

And finally start tomcat:

> cd apache-tomcat-7.0.53
> bin/startup.sh

To configure Tomcat as service type the following commands:
Change to the /etc/init.d directory and create a script called 'tomcat' as shown below:

> cd /etc/init.d/
> vi tomcat

Attention to copy this script, check if JAVA_HOME folder is correct:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash  
# description: Tomcat Start Stop Restart  
# processname: tomcat  
# chkconfig: 234 20 80  
JAVA_HOME=/usr/lib/java-1.7.0/
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH  
CATALINA_HOME=/usr/local/apache-tomcat-7.0.53

case $1 in  
start)  
sh $CATALINA_HOME/bin/startup.sh  
;;   
stop)     
sh $CATALINA_HOME/bin/shutdown.sh  
;;   
restart)  
sh $CATALINA_HOME/bin/shutdown.sh  
sh $CATALINA_HOME/bin/startup.sh  
;;   
esac      
exit 0

Then change file permission:

> chmod 755 tomcat

Now we use the chkconfig utility to have Tomcat start at boot time typing the commands:

> chkconfig --add tomcat
> chkconfig --level 234 tomcat on

2.2. Downloading BOWS

BOWS is available at https://sourceforge.net/projects/bows/files/latest/download
After downloading the file, open a terminal, go to the directory where BOWS was downloaded and extract the content of BOWS.tar.gz by typing:

> tar -xzvf BOWS.tar.gz

2.3. Creating and configuring BOWS database

BOWS is configured to access MySQL as user "bows" with password "bows123". Here we assume that you have MySQL installed in your computer and create this user account (If not, see section MySQL in Requirements). To create and fill a MySQL database for BOWS usage, follow this procedures:

2.3.1. Creating a database for MaLe-PSI-BLAST

Open a Terminal and access the bows account on MySQL by typing the command:

> mysql -u bows -pbows123

In the MySQL environment, create a database named bows by typing this command:

mysql> create database bows;

To ensure that the database was created type the command:

mysql> show databases;

2.3.2. Populating the database

You will find the file "bows.sql" corresponding to database dump into the folder BOWS/
To restore the tables into database, type the following command in the Terminal:

> mysql --user=bows --password=bows123 bows < bows.sql

2.4. Installing BOWS

To install the BOWS service, copy the file "BOWS.war" file into "webapps" folder of Apache Tomcat:

> cp BOWS.war /usr/local/apache-tomcat-7.0.53/webapps/

Then restart the tomcat service by typing:

> service tomcat restart

After that BOWS will be working at address http://localhost:8080/BOWS/

3. BOWS usage

4. Advanced topics

5. References