Skip to content

Instantly share code, notes, and snippets.

@kieranja
Last active August 29, 2015 14:02
Show Gist options
  • Save kieranja/64cf8ef0b4e5c66be073 to your computer and use it in GitHub Desktop.
Save kieranja/64cf8ef0b4e5c66be073 to your computer and use it in GitHub Desktop.
Play Framework & Activator cheatsheet

Running on EC2 Microinstance

You'll need to lower the memory of the JVM:

echo 'export _JAVA_OPTIONS="-Xms128m -Xmx256m -XX:PermSize=64m"' >> ~/.bashrc

Then you'll need to add activator to the PATH variable

echo "export PATH=$PATH:/path/to/dir" >> ~/.bashrc

Then, start a new bash

bash

Running on a different port

When in activator, just add a space after start or run and specify the port. Example:

run 80

or

start 80

Starting server

  1. Create a distributable from activator (command: "dist")
  2. Push to server
  3. Create a .sh file and dump this in:
nohup bin/executable -J-server -Dconfig.file=conf/application.conf -Dhttp.port=80 &
  1. chmod +x start.sh (or the filename you chose above)
  2. ./start.sh
  3. Server should be running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment