1. Setting up Play Framework
Deploying Play Framework in EC2 - part # 3
Kamarul kawnayeen
2. Preface
This is the final part of deploying playframework in EC2 tutorial series. At part
one, I showed how to setup a virtual server. At part two, I setup lamp stack on
that virtual server. In this part, I’ll show how to deploy a play application. It will
require following steps:-
➢ Install Java Development Kit (jdk)
➢ Setup typesafe activator
➢ Create & deploy play application
4. Connect with your remote server using terminal & use the following two
command -
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
5. now, use sudo apt-get install oracle-java8-installer -y
hit enter to agree with the java license
6. Select “<Yes>” to install oracle jdk
Once you are done, use the following command to check java version
java -version
8. create a directory for activator and go there
sudo mkdir /usr/share/activator
cd /usr/share/activator
now download activator using the following command
sudo wget http://downloads.typesafe.com/typesafe-activator/1.3.2/typesafe-activator-1.3.2.zip
13. now either restart your virtual machine or use “source .bashrc”
go to the directory where you want to create your application and type “activator new”
15. As we are working on a free t2 micro instance & we have only 1 GiB of Ram, so we must face problem in
starting the play application. An easy work around is lowering the heap memory.
So first set initial heap size to 128 M & max heap size to 512 M by the following command
export _JAVA_OPTIONS=”-Xms128m -Xmx512m”
then use the following
activator start
16. once the application started, go to your browser & type
{ip_address_of_your_virtual_machine}:9000
and hit enter
All praises and thanks be to Allah, the lord of ‘Alamin
(mankind, jinns and all that exists)
(Al-Fatihah : 2)