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.
Have you seen these tutorials...
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.
http://blog.phusion.nl/2012/10/24/phusion-passenger-4-0-beta-1-is-here/
And
http://blog.phusion.nl/2013/01/24/phusion-passenger-4-0-beta-2-syscall-failure-simulation-framework-focus-on-stability/
Download the tarball from Google Code here:
Next, add the following lines to your Apache configuration file (either apache.conf or the sites-enabled config file):
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.
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.