Deployment Question

Passenger is not available for windows. However, it seems for a simple deployment configuration, under windows, I can just simply put the virtual hosts section into http.conf, e.g.:

<VirtualHost *>     ServerName mysite     DocumentRoot C:/InstantRails/rails_apps/mysite     ProxyPass / http://localhost:3000/     ProxyPassReverse / http://localhost:3000 </VirtualHost>

add a line into my windows hosts file:

127.0.0.1 mysite

fire up apache, fire up mongrel with:

ruby script/server -e production -p 3000

and away I go. Am I wrong? Isn't this about the simplest and easiest means of deployment? -Janna

Passenger is not available for windows. However, it seems for a simple

deployment configuration, under windows, I can just simply put the

virtual hosts section into http.conf, e.g.:

<VirtualHost *>

ServerName mysite

DocumentRoot C:/InstantRails/rails_apps/mysite

ProxyPass / [http://localhost:3000/](http://localhost:3000/)

ProxyPassReverse / [http://localhost:3000](http://localhost:3000)

add a line into my windows hosts file:

127.0.0.1 mysite

fire up apache, fire up mongrel with:

ruby script/server -e production -p 3000

and away I go. Am I wrong? Isn’t this about the simplest and easiest

means of deployment? -Janna

Janna, I’m thinking that this will work to a certain point before you decide to

use something like a mongrel cluster which has better management for your

Rails application. Also, you might be so inclined to port Passenger to Windows

platform because Apache exists for Windows.

Good luck,

-Conrad

JannaB wrote:

Passenger is not available for windows. However, it seems for a simple deployment configuration, under windows, I can just simply put the virtual hosts section into http.conf, e.g.:

<VirtualHost *>     ServerName mysite     DocumentRoot C:/InstantRails/rails_apps/mysite     ProxyPass / http://localhost:3000/     ProxyPassReverse / http://localhost:3000 </VirtualHost>

add a line into my windows hosts file:

127.0.0.1 mysite

fire up apache, fire up mongrel with:

ruby script/server -e production -p 3000

and away I go. Am I wrong? Isn't this about the simplest and easiest means of deployment? -Janna

Yes, you can do this -- it's more or less what everyone did before Passenger came along; Passenger just automates it. However, you'll want multiple Mongrel processes if you're doing anything remotely close to production use, and at that point Windows is no longer an appropriate choice for other reasons anyway (such as security). I think you'd be better advised to deploy on *nix of some sort (perhaps in a VM?), so the point is kind of moot.

Best,

On Windows?

Try JRuby, simplest way to get it working and you won't even have troubles with native gems.

No way -- have you tried to make a war file with warbler? I am an ex Java programmer -- and the JRuby java-style of deployment defeats the purpose of why we all went to Ruby!

Who said you need warbler or a war file? Have you searched for the glassfish gem or jetty-rails?

You'll be amazed how it's easier than dabbling in Apache config, specially on Windows.

This was what I was able to find in regards to JRuby using Glassfish:

http://download.java.net/javaee5/screencasts/jruby-in-glassfish/

In short, it seems to be a very slow process when it comes time to

generate your first Rails application because it needs to import

the required gems into the war file. However, it seems that it gets

a little faster after future deployments but the war file creation

appears to slow and/or he was working on a very slow machine.

In contrast, Charles Nutter gave a great talk at Railsconf 2009 and

he really showed the speed of JRuby. Also, he did a demo on the

threading capabilities of JRuby showing true parallel threads whereas

Ruby 1.8.6 (MRI) and Ruby 1.9.1 (YARV) do not have this feature at

this time because of the global interpreter lock (GCL).

-Conrad

It's ALL NONSENSE. I do NOT want to "war" things up. Been there -- done that, left it behind. Things should be able to run out of a filesystem, without modification, without all kinds of steps. Otherwise, we're going backwards, Jruby notwithstanding. -Janna

Why do you need to go WAR route?

Give glassfish gem a try:

Assuming you have JDK6 and JRuby installed

Install:

$ jruby -S gem install glassfish

To run:

$ cd your-app $ glassfish

There is no warring here. The gem is about 3.4 MB in size and directly run Rails or Rack based frameworks (Merb, Sinatra, Ramaze) by hooking up HTTP (grizzly framework) with the framework of your choice.

-vivek

Vivek,

Have you tried this on a system with Sun Application Server on it? I get:

G:\jruby\rails_apps\myapp>glassfish

G:\jruby\rails_apps\myapp>asadmin start-domain domain1. Starting Domain domain1., please wait. Log redirected to G:\Sun\SDK\domains\domain1.\logs\server.log. Redirecting output to G:/Sun/SDK/domains/domain1/logs/server.log Domain domain1. is ready to receive client requests. Additional services are bei ng started in background. Domain [domain1.] is running [Sun Java System Application Server 9.1_02 (build b 04-fcs)] with its configuration and logs at: [G:\Sun\SDK\domains]. Admin Console is available at [http://localhost:4848]. Use the same port [4848] for "asadmin" commands. User web applications are available at these URLs: [http://localhost:8080 https://localhost:8181 ]. Following web-contexts are available: [/web1 /__wstx-services ggripv2 ]. Standard JMX Clients (like JConsole) can connect to JMXServiceURL: [service:jmx:rmi:///jndi/rmi://XP1:8686/jmxrmi] for domain management purposes. Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ]. Domain does not support application server clusters and other standalone instanc es.

G:\jruby\rails_apps\myapp>

Vivek, you might want to create a screencast on how to deploy a Rails application

using JRuby and Glassfish. This will be helpful to others that want to use JRuby

as well as disprove some of the negative myths attached to it.

-Conrad

Have you tried the Glassfish gem before writing so much nonsense?

http://glassfishgem.rubyforge.org/

You could at least read what people are saying before answering.

This is cool. No repackaging -- and if I am correct, when running in glassfish (on Windows systems, jruby -S glassfish ) I am running in a true J2EE application server every bit as powerful as, say JBoss?

Not exactly.

The Http connector (which is the really important part) is the same Grizzly NIO connector that goes inside the full fledged Glassfish, but this is a lite version with most of the Java EE garbage striped out. You wouldn't need it anyway in a Rails application, no reason to keep it.

In Java parlance it's simple servlet container.

So, in effect, it is more like running under tomcat, without having to make a war file and all that java-nonsense -- and since I am running in JRuby, I get the full power of that.

So...then...how is this different than running jruby under mongrel ?

Exactly :slight_smile:

And you call it just like you'd call a mongrel server. Easiest way to get up and running with Ruby on Windows if you don't want to struggle with native gems and natural Ruby slowness on Windows.

The Grizzly connector is a pure Java NIO (means non-blocking) HTTP connector.

It's faster, more reliable and still under development, while mongrel doesn't look very active at the moment.

GlassFish gem and GlassFish application server v2.x are completely two different things. One has nothing to do with another.

If you are using GlassFish gem then it would run your application as I described. See the docs here: http://glassfishgem.rubyforge.org/

On the other hand the only way you can run Rails on GlassFish application server v2.x is by deploying it as a WAR file.

-vivek.

Vivek, it’s all working and the Glassfish gem is very nice indeed:

JRuby 1.3.0RC2

Glassfish Gem 0.9.5

Rails 2.3.2

I say this because I was able to configure glassfish gem with only 2 JRuby runtimes and I was able to serve 1681.10 pages per sec. BTW, I configured ab as follows:

ab -n 1000 -c 100

Very nice work,

-Conrad