I have a Play 2.0 app deployed on EC2 and I start the app with play start
and it runs in the background, I can hit Ctrl-D
and the process will continue to run in the background but then it dies after a while (15 or 20 mins?), not sure why. I usually exit the ssh session after starting the app, I'm hoping that's not the reason.
Assuming that you created a production mode version of your application with the sbt dist command, deployed that zip file to a production server, and have a Play Framework 2.6 application named “myapp,” you can put a command like this in a Unix/Linux shell script to start your Play application:
Project Structure Now, it’s time to load the project code into the IDE and look at the directory structure. In our project directory, we see four directories created by the sbt template: app/controllers, app/views, conf, and public. The controllers directory is where we will store our Scala code
The controllers directory is where we will store our Scala code The views directory is where we’ll save our HTML templates The conf directory contains our router configuration which maps a request URL to a specific class and method
To implement a new action, we open the Scala file ( HomeController.scala) and add a new method that accepts two parameters, calculates their sum, and passes the result to the view template: Now, let’s open the index.scala.html file, add the sum parameter on top of the file, and use it in the content:
nohup play start
works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With