[play-framework] Registering Play as Windows Service in Windows Server

221 views
Skip to first unread message

Bill

unread,
Apr 22, 2010, 9:31:48 PM4/22/10
to play-framework
Hello Play Team,

I've just figured out why play's standalone http server was unable to
accept incoming requests from outside server ( internet). I found
similar symptoms on other servers which ran from command line such
as :svnserve, apache httpd, tracd. They were all unable to accept
incoming requests from outside IF they were ran in command line. On
the contrary, they worked fine if i registered them as windows
services and assigned Windows Firewall rules on them to accept outside
requests. So, is it possible if you guys would release play's service/
daemon for Windows Server like 'playd.exe' or something else ?


Regards,

Bill

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Archer Yongjian Liu

unread,
Apr 22, 2010, 11:31:05 PM4/22/10
to play-fr...@googlegroups.com
Did you open the port ?
--
Thank you.

Bill

unread,
Apr 22, 2010, 11:33:48 PM4/22/10
to play-framework
Yep. I have opened the port. It only happened in windows Server 2008
only.

Regards,

Bill

On Apr 23, 11:31 am, Archer Yongjian Liu <y...@kalengo.com> wrote:
> Did you open the port ?
>
>
>
> On Fri, Apr 23, 2010 at 9:31 AM, Bill <saintc0...@gmail.com> wrote:
> > Hello Play Team,
>
> > I've just figured out why play's standalone http server was unable to
> > accept incoming requests from outside server ( internet). I found
> > similar symptoms on other servers which ran from command line such
> > as :svnserve, apache httpd, tracd. They were all unable to accept
> > incoming requests from outside IF they were ran in command line. On
> > the contrary, they worked fine if i registered them as windows
> > services and assigned Windows Firewall rules on them to accept outside
> > requests. So, is it possible if you guys would release play's service/
> > daemon for Windows Server like  'playd.exe'  or something else ?
>
> > Regards,
>
> > Bill
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > play-framewor...@googlegroups.com<play-framework%2Bunsu...@googlegroups.com>
> > .

Archer Yongjian Liu

unread,
Apr 22, 2010, 11:51:25 PM4/22/10
to play-fr...@googlegroups.com
That sounds strange. Maybe you need to google it on the net. I think it is about the setting of Windows Server 2008.

BTW, I won't use Windows anymore.

Nicolas Leroux

unread,
Apr 23, 2010, 1:33:28 AM4/23/10
to play-fr...@googlegroups.com
Hi Bill,

Good to know that is has nothing to do with Play! itself (what we suspected from the start). Regarding the specific daemon, it has really low priority, and it is not likely going to happen by us because we do not have Windows or windows server 2008. However, feel free to provide one or to blog about your specific problem and how to solve it. I am sure other people using windows server 2008 would be grateful to you ;)

Thanks for sharing your findings,

Nicolas

Bill

unread,
Apr 23, 2010, 2:21:44 AM4/23/10
to play-framework
Hello,

The advantage of having a Windows 2008 Server VPS is you should be
able to deploy your web applications which are built using various
tools such as ASP NET , PHP, Java. Thus reducing your cost for owning
your development server. Apart from that, Playframework is a cool
which i think a good replacement candidate upon using PHP CI. It would
be perfect if we could register play as Windows Service ( similar with
SVN, Filezilla, Trac for Windows) so it would be able to accept
incoming request from outside. is it very difficult to write a windows
service executable ?

Regards,

Billy
> > <play-framework%2Bunsu...@googlegroups.com<play-framework%252Buns...@googlegroups.com>

Bill

unread,
Apr 23, 2010, 2:28:20 AM4/23/10
to play-framework
Hello Nicolas,

Now i am thinking about writing this 'playd.exe', a windows service
for play. It would be helpful if you could mail me any design
documents about starting/stopping play's http server or other info
where i could begin at. Many thanks in advance.

Regards,

Bill

On Apr 23, 1:33 pm, Nicolas Leroux <nico...@lunatech.com> wrote:
> Hi Bill,
>
> Good to know that is has nothing to do with Play! itself (what we suspected from the start). Regarding the specific daemon, it has really low priority, and it is not likely going to happen by us because we do not have Windows or windows server 2008. However, feel free to provide one or to blog about your specific problem and how to solve it. I am sure other people using windows server 2008 would be grateful to you ;)
>
> Thanks for sharing your findings,
>
> Nicolas
>
> On 23 apr 2010, at 03:31, Bill wrote:
>
>
>
> > Hello Play Team,
>
> > I've just figured out why play's standalone http server was unable to
> > accept incoming requests from outside server ( internet). I found
> > similar symptoms on other servers which ran from command line such
> > as :svnserve, apache httpd, tracd. They were all unable to accept
> > incoming requests from outside IF they were ran in command line. On
> > the contrary, they worked fine if i registered them as windows
> > services and assigned Windows Firewall rules on them to accept outside
> > requests. So, is it possible if you guys would release play's service/
> > daemon for Windows Server like  'playd.exe'  or something else ?
>
> > Regards,
>
> > Bill
>
> > --
> > You received this message because you are subscribed to the Google Groups "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/play-framework?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/play-framework?hl=en.

Ramiro Germán Martin

unread,
Apr 22, 2010, 11:25:53 PM4/22/10
to play-fr...@googlegroups.com
I think you can use srvany.exe (it's an Microsoft application that run any program like a service).
I didn't try it with play but i used it with java.exe and it works fine!
Try it!

Bye!


2010/4/22 Bill <saint...@gmail.com>

Bill

unread,
Apr 23, 2010, 5:15:43 AM4/23/10
to play-framework
Hello Ramiro,

I did the same thing as you did but on Trac's standalone httpd server
( tracd.exe). The problem is Play doesn't have its Executable daemon/
windows service at the moment. well, if you said you have did it upon
java.exe, i might try it out then and see its outcome. Going to inform
it to you all later.

Regards,

Bill

On Apr 23, 11:25 am, Ramiro Germán Martin <ramiro.mar...@gmail.com>
wrote:
> I think you can use srvany.exe (it's an Microsoft application that run any
> program like a service).
> I didn't try it with play but i used it with java.exe and it works fine!
> Try it!
>
> Bye!
>
> 2010/4/22 Bill <saintc0...@gmail.com>
>
>
>
> > Hello Play Team,
>
> > I've just figured out why play's standalone http server was unable to
> > accept incoming requests from outside server ( internet). I found
> > similar symptoms on other servers which ran from command line such
> > as :svnserve, apache httpd, tracd. They were all unable to accept
> > incoming requests from outside IF they were ran in command line. On
> > the contrary, they worked fine if i registered them as windows
> > services and assigned Windows Firewall rules on them to accept outside
> > requests. So, is it possible if you guys would release play's service/
> > daemon for Windows Server like  'playd.exe'  or something else ?
>
> > Regards,
>
> > Bill
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > play-framewor...@googlegroups.com<play-framework%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/play-framework?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/play-framework?hl=en.

Nicolas Dessaigne

unread,
Apr 23, 2010, 7:51:56 AM4/23/10
to play-fr...@googlegroups.com
About srvany.exe, i'm afraid it won't work. It just launches the command line and no more. For example, when you stop the service, nothing happens. The play instance will continue to run... you need to kill it manually.

Nicolas

2010/4/23 Bill <saint...@gmail.com>

Nicolas Leroux

unread,
Apr 23, 2010, 7:58:29 AM4/23/10
to play-fr...@googlegroups.com
Hi,

You have a look at http://commons.apache.org/daemon/procrun.html to see if it helps.

Nicolas

Bill

unread,
Apr 23, 2010, 11:25:47 AM4/23/10
to play-framework
Hello All,

Thank you for all of your responses to my distress call so far. Good
news! thanx to Ramiro's advices, i'm able to host Yabe in my Windows
Server 2008 VPS. So here are the steps to follow :
- Download and install "Windows Server Resource Kit Tools" from msdn
site.
- Run this following command to register Yabe ( or other play's
application folder ) within command prompt ( type & enter cmd within
run box):
%WIN_SERV_RESKIT%\instsrv.exe play.yabe %WIN_SERV_RESKIT%
\srvany.exe reg add HKLM\SYSTEM\CurrentControlSet\Services\play.yabe
\Parameters /v Application /d "\"%PYTHON_HOME%python.exe\" \"c:
\MyJavaSdks\play-1.0.2.1\play\" run "c:\HostedApps\Yabe" --%
%production"
And here are the detail info of that command :
1. %WIN_SERV_RESKIT% => Path to your Windows Server Resource Kit
Tool's application folder.
2. play.yabe => this is the name that will appear within Services
window.
3. %PYTHON_HOME% => Path to your python's installation folder (e.g.
c:\python)
4. "c:\MyJavaSdks\play-1.0.2.1\play" => this is an example of my
PLay's installation folder. Should be adjusted to point to your
local's play folder.
5. "c:\HostedApps\Yabe" => full path of my Yabe's folder.
6. --%%production => additional parameter that mark several configs
within application.conf.
- Setup play's http server within application.conf as shown below :
%production.http.port=9000
%production.http.address=0.0.0.0
- Refresh your Services window. A new service should be appear within
the list and labeled as 'play.yabe'. If you can't find it, then the
registration was failed. Common pitfalls when running the registration
command is caused by incorrect entered command paramters such as
incorrect path of Python's home, play application folder's. You can
correct it manually through registry editor. Within your opened
regisry editor, browse to 'HKLM\SYSTEM\CurrentControlSet\Services
\play.yabe\Parameters' , look at 'Application' entry in there. Fix its
value if you find there is incorrect paramater in there.
- At this point, you should see 'play.yabe' within your services
window. Start the service, open your browser and browse to your server
address:9000. Your yabe should be loaded.
- To enable the Yabe's server accepting requests from outside server's
domain ( internet), create a firewall rule ensure that this rule
should open Play's port. Enable the rule. Restart play.yabe. Try
browse your yabe from your laptop/PC which is connected to internet.

Well Play Team, i guess it won't be harmful if you guys put this
useful info into Play's Documentation, section Deployment guide.

Cheers,

Bill

On Apr 23, 7:58 pm, Nicolas Leroux <nico...@lunatech.com> wrote:
> Hi,
>
> You have a look athttp://commons.apache.org/daemon/procrun.htmlto see if it helps.
>
> Nicolas
> On 23 apr 2010, at 13:51, Nicolas Dessaigne wrote:
>
>
>
> > About srvany.exe, i'm afraid it won't work. It just launches the command line and no more. For example, when you stop the service, nothing happens. The play instance will continue to run... you need to kill it manually.
>
> > Nicolas
>
> > 2010/4/23 Bill <saintc0...@gmail.com>
Reply all
Reply to author
Forward
0 new messages