What would it take to have smooth deployment on IIS?

Hey All,

I'm learning rails in a microsoft shop, where asking for an apache install will be controversial. The bits I've been reading about how to install a rails app on IIS are fairly daunting, and I have this nagging feeling that it should be possible to crib something together w/ms' HTTPHandler stuff in asp.net. Probably this is just foolish, but can anybody recommend reading that would lay out some of the issues involved in having a rails server like mongrel talk to a web server?

Thanks!

-Roy

Roy Pardee Research Analyst/Programmer Group Health Center For Health Studies (Cancer Research Network) (206) 287-2078 Google Talk: rpardee

I didnt have any issues getting mongrel and IIS to cooperate.

I used http://www.isapirewrite.com/ to rewrite the url to the mongrel instance. Its pretty similar to apache mod_rewrite in terms of syntax.

Note that isapi_rewrite does cost a pretty penny. http://cheeso.members.winisp.net/IIRF.aspx is a free alternative but I havent used it. - Richard

Well, I have no idea how to do this, but you need to start by researching how to use IIS as a proxy server. Here's the concept of what happens when you use an Apahce/mongrel combo with 2 mongrel instances (called a "mongrel_cluster").

Request 1 -> Apache -> Mongrel 1 # Response -> Apache -> User Request 2 -> Apache -> Mongrel 2 # same Request 3 -> Apache -> Mongrel 1 # same

It doesn't work exactly like a round-robin -- that's just for demonstration -- it uses mod_proxy_balancer to balance the requests between all the mongrel instances. You can operate a small website off of one mongrel, but if you get 2 requests within the same quarter- second (or however long it takes mongrel to execute the first request) the second request will have to wait until the first finishes.

Also, remember that Apache runs on Windows, too -- you'll probably have to compile the appropriate modules, though.

Now for what you know your going to hear: I really don't recommend this. A good Engineer (i.e. a good Software Engineer) chooses the right tool for the job. If the job requires Linux and Apache, that's what you ought to use. Likewise, if the job requires IIS, that's what you ought to use. Also, remember that the "right" tool is the one that is most efficient (both coding efficiency and running- efficiency), most secure, etc. Politics really isn't a good measure of "rightness," as a matter of fact, politics has a tendency to work against rightness.

Thanks very much--I may try and look into this. I guess the (somewhat) tricky bit is to rejigger the URLs in the outgoing HTML stream so that they no longer refer to particular Mongrel instances (ports & so on) but rather to the IIS "application". Ooh--and to convey cookies, request parameters, user agent strings, etc. from end users to the mongrels... Feh, that's starting to sound like work. :wink:

And totally well-taken on the 'right tool' stuff. I consider my effort an attempt to expand the toolbox here, but I am definitely sympathetic to our IT folks' desire to not have lots of webservers to admin. I would really like to be able to tell them a lovely story about how rails can fit into our existing infrastructure w/out too much fuss or bother...

Thanks!

-Roy

Well, that's promising. Can you say what docs you used to guide your setup? Thanks!

Yeah, the cost of isapi_rewrite was a definite turn-off--kind of kills the FOSS buzz behind using ruby and rails (not that IIS doesn't but at least that's already bought). :wink:

Thanks!

-Roy

[mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Richard Luther

I tried the stealth approach first: fired up a Linux server in VMWare on the IIS server. Once it proved it's worth, it was not hard to get buy in for the server to be a full time player in the domain.

FYI

IIRF (http://cheeso.members.winisp.net/IIRF.aspx ) is an open-source project run on Codeplex: www.codeplex.com/IIRF. There is someone else who used IIRF in a RoR scenario, look for www.codeplex.com/RORIIS. I know about IIRF, but not about RORIIS.