On-site installation

Installing tinyPM on Tomcat

In these instructions we will show you how to setup and configure tinyPM web application on your server.



Windows installation video on YouTube


Requirements

We need to have the following software installed:

  1. Java JRE - we recommend to use version 6.0: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html
  2. Apache Tomcat 7.0.x http://tomcat.apache.org/download-70.cgi
  3. MySQL 5.x http://dev.mysql.com/downloads/mysql/#downloads

Step 1 - download and deploy tinyPM

Let's download and deploy tinyPM http://www.tinypm.com/download as an exploded war in your TOMCAT_DIR/webapps directory.

1. First, we have to stop Tomcat server.

2. Now, let's create your tinyPM directory in Tomcat webapps folder:

TOMCAT_DIR/webapps/tinypm

3. Now unzip downloaded tinypm-3.x-onsite.war to the created directory TOMCAT_DIR/webapps/tinypm

Webapps directory structure should look like this:

/webapps
    /tinypm
        /css
        /docs
        /fonts
        /images
        /img
        /js
        /less
        /META-INF
        /plugins
        /WEB-INF
        INSTALL.txt

Step 2 - set up database

1. Let's start by making a new database in which tinyPM can store its data. For this we will connect to the MySQL via command line client. Open terminal, type in: 'mysql -u root -p' and execute the following command:

CREATE DATABASE tinypm3 CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci';

2. Now it's time to create a user that tinyPM will use to access the database. Change 'password' to some real password and remember it - it'll be needed later).

GRANT SELECT, UPDATE, INSERT, LOCK TABLES, DELETE ON tinypm3.* TO 'tinypm'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

3. Now we need to populate the db with initial data:

Execute in MySql console:

\u tinypm3
\. TOMCAT_DIR/webapps/tinypm/WEB-INF/sql-on-site/create.sql

Step 3 - configure application

Once the database is all set up, we have to edit application settings. Open and modify webapps/tinypm/WEB-INF/classes/tinypm-onsite.properties

Enter email address of admin user:

########################################################
# Admin account
########################################################
tinypm.admin.email = alice@example.com

Modify tinyPM database configuration and set your password (configured in 2.2):

########################################################
# Database
########################################################

dataSource.url = jdbc:mysql://localhost:3306/tinypm3?autoReconnect=true dataSource.username = tinypm dataSource.password = password

Configure a directory for uploads (images, attachments):

########################################################
# Attachments
########################################################
# File attachments directory.
# NOTE: tinyPM stores uploaded files on disk so make sure to include
#       specified location in your backup plan along with tinyPM database backups.
# Windows example:
# tinypm.upload.dir = = C:/tinyPM/uploads
#
# Linux example:
# tinypm.upload.dir = /var/tinypm/uploads

tinypm.upload.dir =

Configure location for search index:

# Full text search index directory.
# NOTE: tinyPM stores search index on disk but you don't need to backup
#       index files as tinyPM is able to recreate them on startup.
#
# Windows example:
# searchable.compassConnection = C:/tinyPM/search
#
# Linux example:
# searchable.compassConnection = /var/tinypm/search

searchable.compassConnection =

Step 4 - Tomcat memory tuning

tinyPM requires more memory than available by default on fresh Tomcat installation.

Windows

Go to Configure Tomcat -> Java and set follow values:
Initial memory pool: 256
Maximum memory pool: 768
Thread stack size: 256

Linux/Mac

You can configure it by adding following params to your java options in TOMCAT_DIR/bin/setenv.sh (please create the file if it doesn't exist yet):
export JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+UseParallelGC"

You can set the second option (-Xmx) to the highest amount available in your system.

Step 5 - run tinyPM

Start your Tomcat server.

Point your browser to http://localhost:8080/tinypm and login as:

  • user: admin
  • password: admin

Congratulations! Your tinyPM is up and running!

Next Steps

1. We'll have to change admin password. Using default password 'admin' is not very good idea.

2. Mail notifications are really nice feature of tinyPM, to be able to use them, we need to configure SMTP:

Configure SMTP server:

########################################################
# Mail Settings
########################################################

grails.mail.default.from = alice@example.com

grails.mail.host = example.com grails.mail.port = 465 grails.mail.username = mail-user grails.mail.password = mail-password # one of: SSL, TLS, DEFAULT tinypm.mail.security = SSL

Application base URL

In the same file webapps/tinypm/WEB-INF/classes/tinypm-onsite.properties you can configure base URL.

Base URL is the URL which will be used for links in notification e-mails, GitHub integration URL (in that case it must be external = accessible over the Internet).

# Application base URL
grails.serverURL = http://your_domain:port/tinypm