Deploying Ringo to WinServer 2008

34 views
Skip to first unread message

Nathan Garrett

unread,
Sep 28, 2010, 6:31:05 PM9/28/10
to RingoJS
Hello All;

I'm working on deploying my application (still heavily under
development) to a local server. I'm looking at a Windows 2008 server.

I don't have any trouble actually starting it for development -- that
works fine. What I'm struggling with is the best practices way of
actually loading it as a service and not a console application. I've
experimented with various .bat or .cmd files, but haven't had any
luck, and think I'm hitting this the wrong way. There's some stuff
about deploying to GAE, but nothing about a regular server.

There's some notes about deploying as a war file, in the below.

[13:25] <oravecz> are there any docs or scripts to package my app up
for deployment to external Java web servers?
[13:27] <hannesw> oravecz you mean packaging for a servlet container?
[13:28] <hannesw> we now have ringo-admin create -a which creates
something you can deploy on google app engine, which happens to use
servlet web apps
[13:28] <hannesw> and olegp has been working on a script that creates
a .war file from an app
[13:28] <hannesw> http://ringojs.pastebin.com/WgtXUuLV

Is the best-case to follow the script given above and deploy as a WAR
in a regular Java server (such as Tomcat)? It looks a little rough,
and I just wanted to know if I'm missing something before I dive in
and try to figure it out.

thanks in advance;

Nathan

Hannes Wallnoefer

unread,
Sep 28, 2010, 6:39:29 PM9/28/10
to rin...@googlegroups.com
2010/9/29 Nathan Garrett <profg...@gmail.com>:

> Hello All;
>
> I'm working on deploying my application (still heavily under
> development) to a local server. I'm looking at a Windows 2008 server.
>
> I don't have any trouble actually starting it for development -- that
> works fine. What I'm struggling with is the best practices way of
> actually loading it as a service and not a console application.  I've
> experimented with various .bat or .cmd files, but haven't had any
> luck, and think I'm hitting this the wrong way. There's some stuff
> about deploying to GAE, but nothing about a regular server.

We use jsvc from the Apache Commons daemon project to run Ringo as
service on Debian/Ubuntu. Jsvc is mainly for Unix systems, but there
is another tool called Procrun that does the same for Windows:

http://commons.apache.org/daemon/procrun.html

I never tried it, but it may be working for you.

> There's some notes about deploying as a war file, in the below.
>
> [13:25] <oravecz> are there any docs or scripts to package my app up
> for deployment to external Java web servers?
> [13:27] <hannesw> oravecz you mean packaging for a servlet container?
> [13:28] <hannesw> we now have ringo-admin create -a which creates
> something you can deploy on google app engine, which happens to use
> servlet web apps
> [13:28] <hannesw> and olegp has been working on a script that creates
> a .war file from an app
> [13:28] <hannesw> http://ringojs.pastebin.com/WgtXUuLV
>
> Is the best-case to follow the script given above and deploy as a WAR
> in a regular Java server (such as Tomcat)? It looks a little rough,
> and I just wanted to know if I'm missing something before I dive in
> and try to figure it out.

This reminds me that Oleg has written a ringo-admin script to package
applications as WAR files. We should merge that to Ringo mainline.

http://github.com/olegp/ringojs/commit/86fc80584683be4202c538119641ca672edf5499

Hannes

> thanks in advance;
>
> Nathan
>
> --
> You received this message because you are subscribed to the Google Groups "RingoJS" group.
> To post to this group, send email to rin...@googlegroups.com.
> To unsubscribe from this group, send email to ringojs+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ringojs?hl=en.
>
>

Nathan Garrett

unread,
Sep 29, 2010, 6:06:50 PM9/29/10
to RingoJS
Thanks Hannes; I really appreciate the pointer.

I worked for a while on procrun's children program prunmgr, but wasn't
able to get it to run. Each time, I'd get a 'rpnmgr service failed to
start' due to a 'did not respond to the start or control request in a
timely fashion...' In trying to simulate it thru the command line, I
verified that my classpath and class are correct, but without a better
error message, it's hard to know where to look.


I'll try looking into the WAR option, or just settle for a simple
batch file on boot.

appreciate the help!

Nathan

On Sep 28, 3:39 pm, Hannes Wallnoefer <han...@helma.at> wrote:
> 2010/9/29 Nathan Garrett <profgarr...@gmail.com>:
> http://github.com/olegp/ringojs/commit/86fc80584683be4202c538119641ca...

Oleg Podsechin

unread,
Oct 4, 2010, 12:33:04 PM10/4/10
to RingoJS
Deploying as a WAR has worked well for me on Linux, since that way I
can

a) use other web app containers, such as Tomcat (as long as I don't
use httpclient from trunk ;)
b) get to use the distro's own packages for setting up the webapp
container itself
c) use the upstart /etc/init.d scripts and logging config that come
with the webapp container
d) run ringo webapps alongside other Java webapps

On Windows, you could use http://docs.codehaus.org/display/JETTY/Win32Wrapper
to run Jetty as a service, or alternatively use the "run Tomcat as a
service" scripts that come with the Tomcat setup package.

The package script isn't too difficult to work with & I'll make the
changes necessary to have it work with the latest version of Ringo
this week so it can be merged into the main project.

As an aside, I really think that the process of 1) create project ->
2) develop -> 3) package for deployment should be simplified in Ringo.
Rather than knowing up front which platform you want to deploy to, you
should be able to just create a skeleton Ringo app consisting of a few
necessary files like main.js, config.js and app.js and use that for
development. Once you're done developing, you'd package it for
distribution as 1) a standalone jar with embedded jetty 2) a standard
WAR 3) a GAE WAR etc. etc.

The current approach makes Ringo apps seem more complicated than they
are, for example, check out the JSONP proxy that my friend Jason made
the other day:

http://github.com/jasondavies/seivadnosaj-js

Looks complicated, right? In actual fact, the entire app is just this
file: http://github.com/jasondavies/seivadnosaj-js/blob/master/WEB-INF/app/actions.js

Oleg

Nathan Garrett

unread,
Oct 5, 2010, 1:13:01 PM10/5/10
to RingoJS
Thanks Oleg;

I kinda did the hacky solution and just added a run on start batch
file, but that really isn't ideal, as it locks the config.js file and
prevents easy updating of the code.

Deploying as a WAR sounds like a good idea. I'll probably hold off on
updating until the 'official' ringo .war creator is finished (which
sounds like a fantastic idea, btw). I'm very easily distracted, and
trying to focus on getting to my 'minimum viable software' for 3rdRow.

Appreciate the info;

Nathan

On Oct 4, 9:33 am, Oleg Podsechin <oleg.podsec...@gmail.com> wrote:
> Deploying as a WAR has worked well for me on Linux, since that way I
> can
>
> a) use other web app containers, such as Tomcat (as long as I don't
> use httpclient from trunk ;)
> b) get to use the distro's own packages for setting up the webapp
> container itself
> c) use the upstart /etc/init.d scripts and logging config that come
> with the webapp container
> d) run ringo webapps alongside other Java webapps
>
> On Windows, you could usehttp://docs.codehaus.org/display/JETTY/Win32Wrapper
> to run Jetty as a service, or alternatively use the "run Tomcat as a
> service" scripts that come with the Tomcat setup package.
>
> The package script isn't too difficult to work with & I'll make the
> changes necessary to have it work with the latest version of Ringo
> this week so it can be merged into the main project.
>
> As an aside, I really think that the process of 1) create project ->
> 2) develop -> 3) package for deployment should be simplified in Ringo.
> Rather than knowing up front which platform you want to deploy to, you
> should be able to just create a skeleton Ringo app consisting of a few
> necessary files like main.js, config.js and app.js and use that for
> development. Once you're done developing, you'd package it for
> distribution as 1) a standalone jar with embedded jetty 2) a standard
> WAR 3) a GAE WAR etc. etc.
>
> The current approach makes Ringo apps seem more complicated than they
> are, for example, check out the JSONP proxy that my friend Jason made
> the other day:
>
> http://github.com/jasondavies/seivadnosaj-js
>
> Looks complicated, right? In actual fact, the entire app is just this
> file:http://github.com/jasondavies/seivadnosaj-js/blob/master/WEB-INF/app/...
Reply all
Reply to author
Forward
0 new messages