Version 1 (modified by work@…, 3 years ago)

--

Setting up a dedicated server

In this guide we will assume you use Linux as a hosting platform. While you will be able to run GSCF on Windows, using Linux is preferable. This guide is written with  Debian GNU/Linux (or Ubuntu) as a hosting platform. As Linux distributions differ other distributions may require minor changes in setup, but following this guide you should be able to get things running on other distributions as well.

Assumptions

The tutorial is based on a number of assumptions: * you have root access to the server * we will set up a gscf test instance on test.mysite.com on IP (1.2.3.4) * a DNS records is available for test.mysite.com * our database will be named 'mytestdb' with username 'mydbuser' and password 'mydbpassword' * we will have one administrator user (user 'admin', password 'adminpw') * we will have one default user (user 'user', password 'userpw')

Requirements

Before we can set up the server, the following requirements should be met: * Apache Tomcat ≥ 6.x.x * Apache Webserver ≥ 2.x (+mod_proxy, +mod_rewrite) * PostgreSQL database server ≥ 8.4

Installation is quick and easy:

apt-get install tomcat6 postgresql-8.4 apache2 libapache2-mod-proxy-html libapache2-mod-jk

Set Up the Database

su to user postgres and create the database:

root@nmcdsp:~# su - postgres
postgres@nmcdsp:~$ psql
Welcome to psql 8.3.14, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=# create database 'mytestdb';
CREATE DATABASE
postgres=# create user mydbuser password 'mydbpassword';
CREATE ROLE
postgres=# grant all privileges on database mytestdb to mydbuser;
GRANT
postgres=# grant all privileges on database mytestdb to mydbuser;
GRANT
postgres=# alter database mytestdb owner to mydbuser;
ALTER DATABASE
postgres=# \l
           List of databases
    Name     |     Owner     | Encoding 
-------------+---------------+----------
 mytestdb    | mydbuser      | UTF8
 postgres    | postgres      | UTF8
 template0   | postgres      | UTF8
 template1   | postgres      | UTF8
(16 rows)

postgres=# \q
postgres@nmcdsp:~$ exit
logout
root@nmcdsp:~# 

Set up the application configuration

Currently this is a manual step, but in the future the application will contain a getting started wizard which will do this for you (see #185).

GSCF supports externalized configuration which it expects to be in a .grails-config folder on the homedir of the tomcat user. In this case the homedir of the tomcat6 user is /usr/share/tomcat6/.grails-config so it will try to load the configuration file /usr/share/tomcat6/.grails-config/nmcdsptest-gscf.properties.

First, create the folder to hold the configuration file(s):

root@nmcdsp:~# cd /usr/share/tomcat6
root@nmcdsp:/usr/share/tomcat6# mkdir .grails-config;chown -R tomcat6.tomcat6 .grails-config;chmod gou+rx .grails-config
root@nmcdsp:/usr/share/tomcat6# cd .grails-config

Then create the configuration file itself:

root@nmcdsp:/usr/share/tomcat6/.grails-config# nano nmcdsptest-gscf.properties
}}

And paste the following configuration:
{{{
# Test build default configuration
# server URL
grails.serverURL=http://test.mysite.com

# DATABASE
dataSource.driverClassName=org.postgresql.Driver
dataSource.dialect=org.hibernate.dialect.PostgreSQLDialect
dataSource.url=jdbc:postgresql://localhost:5432/mytestdb
dataSource.dbCreate=update
dataSource.username=mydbuser
dataSource.password=mydbpassword
#dataSource.logSql=false

# E-MAIL
# use authenticated smtp (make sure your firewall allows
# outbound connections on port 465), or
#  - comment username and password to use non-authenticated
#    mail (on port 25)
#  - comment out all to use local mailer (e.g. postfix /
#    sendmail on port 25)
grails.mail.host=smtp.gmail.com
grails.mail.username=gscf.default.installation@gmail.com
grails.mail.password=s7udycap7r3

# SpringSecurity E-Mail Settings
grails.plugins.springsecurity.ui.forgotPassword.emailFrom=gscf.default.installation@gmail.com

# module configuration
#modules.sam.url=http://test.sam.nmcdsp.org
#modules.metabolomics.url=http://test.metabolomics.nmcdsp.org
#modules.metagenomics.url=http://test.metagenomics.nmcdsp.org

# Number of seconds to keep rest results from modules in cache
modules.cacheDuration = 600

# default application users
authentication.users.admin.username=admin
authentication.users.admin.password=adminpw
authentication.users.admin.email=admin@mysite.com
authentication.users.admin.administrator=true
authentication.users.user.username=user
authentication.users.user.password=userpw
authentication.users.user.email=user@mysite.com
authentication.users.user.administrator=false
}}}

Press CTRL-X to save the file (and enter Y).

== Install GSCF ==
Download and install the latest WAR from [https://trac.nbic.nl/gscf/downloads https://trac.nbic.nl/gscf/downloads] (make sure to replace the URL and WAR names with the most recent versions).

{{{
root@nmcdsp:~# curl "https://trac.nbic.nl/gscf/downloads/8" > /tmp/gscf-0.6.6-nmcdsptest.war
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 47.8M  100 47.8M    0     0  6075k      0  0:00:08  0:00:08 --:--:-- 6602k
root@nmcdsp:~# cd /var/lib/tomcat6/webapps/
root@nmcdsp:/var/lib/tomcat6/webapps# cp /tmp/gscf-0.6.6-nmcdsptest.war .;chown tomcat6.tomcat6 *.war;chmod gou+rx *.war
root@nmcdsp:/var/lib/tomcat6/webapps# 
}}}