Skip to content

R.10 Installation and Configuration

sadeghim edited this page Feb 8, 2013 · 12 revisions

This page describes the steps of installation and configuration of ANDS Online Services R.10 on Centos 6.3 x86_64.

1. Initial System configuration

1. Update YUM repositories

Run following commands with root access:

yum update

2. Disable SELINUX

Make sure that SELinux is disabled:

grep ^SELINUX= /etc/selinux/config` 

otherwise edit the config file and disable it:

nano -c /etc/selinux/config

set SELINUX=disabled and restart the machine shutdown -r now

3. Install EPEL/REMI RPM

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update

Now edit the /etc/yum.repos.d/remi.repo file and under the [remi] block set enabled=1.

4. Install JPackages

 yum install perl
 rpm -Uvh http://mirrors.dotsrc.org/jpackage/6.0/generic/free/RPMS/jpackage-utils-5.0.0-7.jpp6.noarch.rpm
 wget -P  /etc/yum.repos.d/ http://www.jpackage.org/jpackage50.repo
 yum update

2. Installing additional software dependencies

1. Apache Web Server (httpd), PHP and modules

Please note that PHP5.4 and above is not compatible with ANDS Online Services R.10.

yum install  httpd php-5.3.3-14\* php-pgsql-5.3.3-14\* php-mbstring-5.3.3-14\* php-xml-5.3.3-14\* php-devel-5.3.3-14\* php-pdo-5.3.3-14\* php-mysql-5.3.3-14\*

2. Install PostgreSQL/MYSql

rpm -Uvh http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-centos91-9.1-4.noarch.rpm
yum install postgresql91 postgresql91-server postgresql91-contrib
mv /etc/init.d/postgresql-9.1 /etc/init.d/postgresql   # rename this to avoid future pain
yum install mysql mysql-server mysql-devel 

3. Install Java/Tomcat6

rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
yum install  tomcat6 java-1.7.0-openjdk ant ant-contrib
wget -P /usr/share/tomcat6/lib/  http://jdbc.postgresql.org/download/postgresql-9.1-902.jdbc4.jar

4. Install SOLR

cd /usr/local/
wget http://apache.mirror.uber.com.au/lucene/solr/4.1.0/solr-4.1.0.tgz
tar  xzf ./solr-4.1.0.tgz
mv solr-4.1.0 solr41

Create solr.xml file in tomcat as below:

nano /usr/share/tomcat6/conf/Catalina/localhost/solr.xml

Copy the content from here:

<?xml version="1.0" encoding="utf-8"?>
 <Context docBase="/usr/local/solr41/dist/solr-4.1.0.war" debug="0"
   crossContext="true">
 <Environment name="solr/home" type="java.lang.String"
 value="/usr/local/solr41/example/solr/" override="true"/>
 </Context>

Then

 cp /var/www/html/ANDS-Online-Services/arms/misc/solrschema_r10.xml  /usr/local/solr41/example/solr/collection1/conf/schema.xml

SOLR 4.1 is now installed in /usr/local/solr41/ Note that give tomcat access to write in the Solr directory:

chown -R tomcat /usr/local/solr41/example/solr/  

It's time to start tomcat6:

service tomcat6 start

Now, you can check the web server to see that Solr is working: http://your_ip_address:8080/solr

5. Gearman (background task daemon)

6. Install Git client

 yum install git-core

7. Finalize setting up the packages

chkconfig httpd on
chkconfig postgresql on
chkconfig tomcat6 on
chkconfig mysqld on

3. Configuring the ANDS Services

###1. Configuring your firewall (iptables)

Firewall should allow public access to the following ports 80, 8080

Example (note: test these rules thoroughly in your own environment before applying them)

iptables -F INPUT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -I INPUT 3 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables -I INPUT 3 -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
iptables -I INPUT 3 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited
service iptables save

Note (Nectar Users): Nectar also has a VM-level firewall that is configured when you launch the virtual machine. You should ensure that the applicable ports are accessible at this level too. This is configured on the Nectar Dashboard.

2. Get the latest version of the ANDS Online Services:

cd /var/www/html/
git clone -b develop  git://github.com/au-research/ANDS-Online-Services.git
cp -R ANDS-Online-Services/registry/src/ ./cosi
cp -R ANDS-Online-Services/arms/src/ ./orca
cp ./cosi/global_config.sample ./cosi/global_config.php
cp ./orca/global_config.sample ./orca/global_config.php

3. Setting up the COSI database (PostgreSQL)

service postgresql initdb en_AU.UTF-8
 service postgresql start

 su postgres -
  psql

Following commands are executed from the postgres shell:

 CREATE USER webuser;
 CREATE USER dba;
 CREATE DATABASE dbs_cosi ENCODING = 'UTF8' LC_COLLATE = 'en_AU.UTF-8' LC_CTYPE = 'en_AU.UTF-8';
 ALTER DATABASE dbs_cosi OWNER TO dba;
 GRANT CONNECT, TEMPORARY ON DATABASE dbs_cosi TO webuser;
 GRANT ALL ON DATABASE dbs_cosi TO dba;

 \q

Now import the DB files:

 psql -d dbs_cosi -f /var/www/html/ANDS-Online-Services/registry/db/release8/dbs_cosi_full.sql
 psql -d dbs_cosi -f /var/www/html/ANDS-Online-Services/registry/db/release8.1_to_8.2_incremental/dbs_cosi_r8.1_to_r8.2.sql
 psql -d dbs_cosi -f /var/www/html/ANDS-Online-Services/registry/db/release8.2_to_9_incremental/dbs_cosi_r8.2_to_r9.sql

 exit

Now Open file pg_hba.conf file and edit the lines as below:

 nano -c /var/lib/pgsql/9.1/data/pg_hba.conf

 host    all             all             127.0.0.1/32            trust
 host    all             all             ::1/128                 trust

Then restart the PostgreSQL:

 service postgresql restart

4. Configure COSI global_config

cd /var/www/html/cosi/

Now edit nano -c global_config.php and change lines according below:

/*======================================
        - Modify This File
======================================*/

/*====================================
        LOCAL WEB SERVER ENVIRONMENT
====================================*/
$host                           = '**your IP address**';
$default_protocol       = 'http';
$cosi_root                      = 'cosi';
$orca_root                      = 'orca';
$rda_root                       = $orca_root.'/rda';

//======================================
$solr_url                       = 'http://127.0.0.1:8080/solr1/';
$datacite_solr_url      = 'http://search.datacite.org/api';
$harvest_url            = '';
$harvester_ip           = '';
$harvest_ip                     = $harvester_ip;
$pids_url                       = "https://devl.ands.org.au:8443/pids/";
$pids_app_id            = '';

//======================================
$deploy_as                      = 'DEVELOPMENT';
$rda_environment        = 'development';
$doi_environment        = 'development';
$debug                          = false;
$error                          = false;

/*====================================
        DATABASE ENVIRONMENT
====================================*/
$cosi_db_host = '127.0.0.1';
$cosi_db_port = 5432;
$cosi_db_name = 'dbs_cosi';
//======================================
//$orca_db_host = $cosi_db_host;
//$orca_db_port = $cosi_db_port;
//$orca_db_name = 'dbs_develop_orca';
//======================================
//$pids_db_host = $cosi_db_host;
//$pids_db_port = $cosi_db_port;
//$pids_db_name = 'pids';
//======================================
//$dois_db_host = $cosi_db_host;
//$dois_db_port = $cosi_db_port;
//$dois_db_name = 'dois';
//======================================

Now you should be able to log in COSI page http://your_ip_address/cosi/login.php using default username/password.

5. Setting up the ORCA database (MySQL)

 service mysqld start
 cd /var/www/html/ANDS-Online-Services/arms/db/mysql/
 mysql  < dbs_harvester_r9_full.sql
 mysql  < dbs_portal_r9_full.sql    # set engine=MyISAM
 mysql  < dbs_registry_r9_full.sql
 mysql  < dbs_vocabs_r9_full.sql 
 mysql < dbs_registry_r9_to_r10_incr.sql
 mysql -e "create user 'webuser'@'localhost';"
 mysql -e "grant SELECT,INSERT,DELETE,UPDATE,CREATE ON dbs_harvester.* TO  'webuser'@'localhost';"
 mysql -e "grant SELECT,INSERT,DELETE,UPDATE,CREATE ON dbs_portal.* TO  'webuser'@'localhost';"
 mysql -e "grant SELECT,INSERT,DELETE,UPDATE,CREATE ON dbs_registry.* TO  'webuser'@'localhost';"
 mysql -e "grant SELECT,INSERT,DELETE,UPDATE,CREATE ON dbs_vocabs.* TO  'webuser'@'localhost';"

6. Configure ORCA

nano -c /etc/httpd/conf/httpd.conf

Change Line 338 as below:

    AllowOverride All

Then,

cd /var/www/html/orca/
nano global_config.php

Change the line number 3,4,54 as below:

$ENV['solr_url'] = "http://localhost:8080/solr1/";
$ENV['harvester_base_url'] = "http://localhost:8080/harvester/";

$eDBCONF['cosi']['hostname'] = 'localhost';

Then

cp htaccess.sample .htaccess
nano -c .htaccess

Change the line 4 as below

RewriteBase /orca/
Clone this wiki locally