I have a Play Framework 2.0 application that I want to deploy (production) on Windows Server 2008 R2. How do I get it to run as a service?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This worked for me on Windows 7:
Go to your Play! app folder in command line and type
play distIn C:\my_app\something-SNAPSHOT\ make a new file start.bat and fill it with command like this:
java -cp "C:\my_app\something-SNAPSHOT\lib\*" play.core.server.NettyServerSave it and launch start.bat. Your play app must start and work as usual. Take a look at server’s PID. You will use it in the next step.
Now using command prompt go to C:\my_app\yajsw\bat and type
genConfig.bat < PID from previous step >You generated C:\my_app\yajsw\conf\wrapper.conf. Edit this file and change these params like so:
wrapper.ntservice.name=My App Name
wrapper.ntservice.displayname=My App Name
Save file.
Terminate the start.bat script you started in 6. then, in C:\my_app\yajsw\bat launch
runConsole.batIf app starts, do a
Ctrl c(and answer y) to terminate the batch file and proceed to next step.To install service launch (Run as administrator)
installService.batTo start service launch
startService.batNow you can see your “My App Name” service in Windows services.
To stop service you can use
stopService.bat. To uninstall ituninstallService.bat.