Wiki

Clone wiki

sts / Install

Installation Instructions

If you have working examples for other combinations of application servers/operating systems, please let me know, and I will update this page.

Jetty8 on Debian/Ubuntu

  • Install OpenJDK (or Oracle Java) version 8
  • Install the Jetty8 application container (available from Debian or Ubuntu repo.)
  • Install the downloaded (or compiled) war file as /var/lib/jetty8/webapps/sts.war
  • Install MySQL or PostgreSQL and create a database and credentials
  • Create the configuration file (see example below) as /usr/share/jetty8/resources/sts-config.groovy

PostgreSQL Configuration

Example of how to create a user and database:

#!shell

root@server:~# su - postgres
postgres@server:~$ psql
psql (9.4.3)
Type "help" for help.

postgres=# CREATE USER sts WITH LOGIN PASSWORD 'ohChaiPh2phohhej';
CREATE ROLE
postgres=# CREATE DATABASE sts WITH OWNER sts TEMPLATE template0 ENCODING 'UTF8';
CREATE DATABASE
postgres=# 

STS Configuration

Replace database and email credentials with your own. Content should go into /usr/share/jetty8/resources/sts-config.groovy.

#!groovy

/* DataSource Configuration */
dataSource {
    pooled = true
    dbCreate = "update"     // Try and update the schema if possible
    //dbCreate = "create"     // This will drop all tables and re-create
    readOnly = false

    // PostgreSQL
    driverClassName = "org.postgresql.Driver"
    dialect = "net.kaleidos.hibernate.PostgresqlExtensionsDialect"
    url = "jdbc:postgresql://localhost:5432/sts"

    // MySQL
    //driverClassName = "com.mysql.jdbc.Driver"
    //dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
    //url = "jdbc:mysql://localhost:3306/sts?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true"

    username = "sts"
    password = "ohChaiPh2phohhej"

    // See http://grails.org/doc/latest/guide/conf.html#dataSource
    properties {
       jmxEnabled = true
       initialSize = 5
       maxActive = 50
       minIdle = 5
       maxIdle = 25
       maxWait = 10000
       maxAge = 10 * 60000
       timeBetweenEvictionRunsMillis = 5000
       minEvictableIdleTimeMillis = 60000
       validationQuery = "SELECT 1"
       validationQueryTimeout = 3
       validationInterval = 15000
       testOnBorrow = true
       testWhileIdle = true
       testOnReturn = false
       jdbcInterceptors = "ConnectionState;StatementCache(max=200)"
       defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
    }

}


/* Server URL - Must be set for absolute links to work correctly */
grails.serverURL = "https://support.my-domain.com/"


/* Grails SMTP (Outgoing Mail) Configuration */
// See the documentation for the 'grails mail plugin' for more information.
grails {
    mail {
        host = "smtp.gmail.com"
        port = 465
        username = "support@my-domain.com"
        password = "DiuZ2kaeJ2thaich"
        props = ["mail.smtp.auth":"true",
            "mail.smtp.socketFactory.port":"465",
            "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
            "mail.smtp.socketFactory.fallback":"false"]
    }
}

// Override mail to/from for testing
// grails.mail.overrideAddress="some-address@your.domain"

// Disable all outgoing mail
// grails.mail.disabled=true

/* STS Configuration */
sts {

    // Support Email
    name  = 'Simple Ticket System'
    email = 'support@my-domain.com'

    // Mail Configuration
    mail {

        inbound {
            protocol = 'imap'  // pop3, pop3s, imap, imaps
            hostname = 'mailserver.my-domain.com'
            username = 'support@my-domain.com'
            password = 'someSecretPassword'
        }

    }

}

// EOF

Updated