Play Framework 2 on Windows Server as service
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
wrapper.java.app.mainclass = play.core.server.ProdServerStart
wrapper.java.classpath.1 = application_dir/dist/lib/*
wrapper.java = your_javadir/bin/java.exe
wrapper.java.command = your_javadir/bin/java
wrapper.java.additional.1 = -Dhttp.port=yourport
wrapper.java.additional.2 = -Dconfig.resource=prod.conf
wrapper.java.additional.3 = -Dlogger.resource=logger.prod.xml
wrapper.java.additional.4 = -Dpidfile.path=NUL
wrapper.java.additional.5 = -Xms80M
wrapper.java.additional.6 = -Xmx80m
wrapper.java.additional.7 = -server
wrapper.console.title = Play App!
wrapper.ntservice.name = 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.
I'm quite a newbie in ASP.NET.... I began working with ASP.NET 1.1, then turned back to C++ and now back again to the ASP.NET world. Now the version is 3.5.... I've been away quite a long time.So, the first impression is very good: just a couple of days for...