Play Framework 2 on Windows Server as service

2 minuti di lettura
Deploy a Play Framework 2 application on Windows Server is not very simple, i'll show our solution.

First step is to build a standalone version of your app with "play dist" command from Play console, you have now a .zip file in your application_dir/dist/ directory, extract the zip in a server folder. Remove the sans-externalized application jar and add the taget/scala-2.xx/appname_2.xx.jar .

The second step is to download YAJSW and extract in the server in yajswdir/ folder and create a .conf  file like:

wrapper.working.dir = application_dir
wrapper.startup.timeout = 60 = play.core.server.ProdServerStart = application_dir/dist/lib/* = your_javadir/bin/java.exe = your_javadir/bin/java = -Dhttp.port=yourport = -Dconfig.resource=prod.conf = = -Dpidfile.path=NUL = -Xms80M = -Xmx80m = -server


wrapper.console.title = Play App! = Play App!
wrapper.ntservice.displayname = Play App!
wrapper.ntservice.description = Play App!

The third and last step is to open a terminal, go to the yajswdir directory and run the command:

[code gutter="false"]java -jar wrapper.jar -i conf/yourconf.conf[/code]

Now you can find the service "Play App!" in your services list.

Questo sito utilizza cookie di terze parti. Per informazioni maggiori leggi la privacy policy. Continuando la navigazione o chiudendo questo banner acconsenti all’uso dei cookie.