Template-Repository Play Framework Install

Full Installation of template-repository

Install template-repository Prerequisites

A full installation requires the following dependencies:

  • Java runtime environment, required by Play Framework.
  • Play Framework 1.2.4. Download and unzip it because you will need the binaries to run the template-repository application.
  • A MySQL database, used to store the repository data (optional)
  • Git, to download the code from the repository.

The following instructions are for Unix operating systems, but the Play Framework can also be installed on Windows.

Installation of Prerequisites on Abiquo Linux

  1. Install Abiquo Linux with no Abiquo components selected
  2. Install the latest version of the Java SDK from Oracle
    1. Download Oracle Java SE Development Kit 7 - Linux x64 (64-bit) RPM
      http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html
    2. Copy the RPM file to the server in the /tmp directory
    3. Install the file using the package manager

      rpm -ivh jdk-7u4-linux-x64.rpm
      
    4. Check the java version

      java -version
      
  3. Install Play! Framework 1.2.4
    http://www.playframework.org/download
    1. Download, for example, while logged in to the server

      wget http://download.playframework.org/releases/play-1.2.4.zip
      cp play-1.2.4.zip /opt/
      cd /opt/
      
    2. Install unzip and unzip Play! Framework

      yum install unzip
      unzip play-1.2.4.zip
      
    3. Export Play! Framework path

      export PATH=$PATH:/opt/play-1.2.4
      
    4. Test play is installed correctly

      play --help
      
  4. Add a repo for yum install of git
    1. Create a repo file. Edit /etc/yum.repos.d/epel.repo and copy and paste the following

      [epel]
      name=Extra Packages for Enterprise Linux 5 - $basearch
      #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
      mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
      failovermethod=priority
      enabled=1
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

      [epel-debuginfo]
      name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
      #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
      mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
      failovermethod=priority
      enabled=0
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
      gpgcheck=1

      [epel-source]
      name=Extra Packages for Enterprise Linux 5 - $basearch - Source
      #baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
      mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
      failovermethod=priority
      enabled=0
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
      gpgcheck=1

    2. Add the key for the repo

      cd /etc/pki/rpm-gpg/
      wget https://fedoraproject.org/static/217521F6.txt
      cp 217521F6.txt RPM-GPG-KEY-EPEL
      rm 217521F6.txt
      
  5. Install git using yum

    yum install git
    

Download the Code from Github

After you install the dependencies, open a shell and go to the directory where you unzipped play framework. More information on the template-repository application can be found on GIT https://github.com/abiquo/template-repository  Download the code for the template-repository using the following command:

git clone git://github.com/abiquo/template-repository.git

Starting the Webapp on the Play Framework

Either go to the directory where you installed the Play Framework and run the template-repository or execute from the template-repository directory with the following commands.  

[root@TAPortal template_repository]# play dependencies template-repository
[root@TAPortal template_repository]# play start template-repository

~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2.4, http://www.playframework.org
~
~ OK, /opt/template_repository/template-repository is started
~ output is redirected to /opt/template_repository/template-repository/logs/system.out
~ pid is 12728

[root@TAPortal template_repository]#

This will run the application in the background and generate a .pid file (above example pid 12728).

Managing the .pid File

You must manage the .pid file carefully because if the machine shuts down ungracefully, the .pid file will still exist when it restarts. This will mean that the application will not be able to start up again, even if it is currently stopped, because a .pid file exists. To delete the .pid file, run the following command:

[root@TAPortal template_repository]# play stop template-repository

Then the application will be able to start again.

Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved