Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Background: I'm developing a Ruby web application, and have decided to switch to JRuby for several reasons that I'm not going to mention here. I have experience with servers such as Apache and Lighttpd, but I have no experience with Java or deploying Java-based web applications.

What would be the best setup for a JRuby web application in terms of server software? (And whatever else I might need.) What server choices do I have? What's different between setting up a Java-based server and, say, Apache? In other words, how do I get started?

Thanks for helping out a newbie. :)

PS: I don't know if it makes a difference since Java is cross-platform, but my development machine runs Vista, so it would be great if I could also use the same setup on Windows for development.

share|improve this question
up vote 3 down vote accepted

Have you seen these tutorials...

share|improve this answer
No, I haven't. Thank you! – Sasha Chedygov May 30 '09 at 19:34
You're welcome =) – Xerxes May 31 '09 at 1:26

May I offer a suggestion that you try the recent 4.0 beta release of Passenger Phusion for Open Source? It integrates with Apache and enables you to install JRuby Rack-based applications in one of your enabled sites.


Download the tarball from Google Code here:

$ curl -O
$ JRUBY_OPTS="-Xcext.enabled=true" jruby ./bin/passenger-install-apache2-module
$ jgem install rack # Or jruby -S gem install rack

Next, add the following lines to your Apache configuration file (either apache.conf or the sites-enabled config file):

   LoadModule passenger_module /usr/local/lib/passenger-3.9.2.beta/libout/apache2/
   PassengerRoot /usr/local/lib/passenger-3.9.2.beta
   PassengerRuby /usr/java/jruby/bin/jruby
   PassengerSpawnMethod direct

Apparently, it can also integrate with nginx, but I cannot confirm that since I haven't tried it.

The Apache integration does indeed work well for me. Please note that this may not be an ideal enterprise setup. First, it's a beta release. Second, it is my understanding that the non-enterprise version of this passenger mod will not be multi-threaded. What that means precisely with respect to a JVM application does not make sense to me, but I haven't researched enough to determined if it is actually an issue. Also note that I am making this recommendation for those who are interested in getting something setup quickly, and specifically using an existing Apache installation.

share|improve this answer

I've been looking into doing this myself, and I'm in a similar boat to the original poster -- plenty of experience running a LAMP stack, but needing to move to JRuby and having precisely nil Java experience.

I've decided to stick fairly closely to how my current Rails apps run (thin behind Apache and mod_proxy_balancer), by putting a Jetty 6 instance behind Apache and mod_proxy.

I looked into GlassFish, and while it was very easy to set up and get running, it's far too much for my needs -- the only part of the Java EE stack I actually need is the servlet container.

This isn't in production yet, but what I should end up with is Apache run by my distro's init scripts, Jetty started by capistrano and/or the init scripts, and everything watched by monit. This is similar enough to how things currently work that I'm comfortable with it, and the only real "eww, Java" moment I've had is working with Jetty's XML configuration file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.