Deploying Rails on Windows servers
Posted by marcel May 11, 2006 @ 02:42 PM
Most Rails applications are deployed in a Unix server environment. Tools like Capistrano make this dead easy. For those working in a Windows environment, deployment can get considerably harder. The good news is that it’s still possible and just got a lot easier.
Brian Hogan has developed a series of articles with instructions for various methods of deploying Rails applications in a Windows server environment. Broken up across four articles, the topics covered are as follows:
- Serving Multiple Rails Applications on Windows with Apache and Mongrel
- Integrate Rails into an Existing IIS Web infrastructure using Apache and FastCGI
- Integrate Rails into an Existing IIS Web infrastructure using Mongrel
- Integrate Rails into an Existing IIS Web Infrastructure using Lighttpd and Mongrel
Cheers to Brian for sharing the fruits of his labor.

What kind of monolothic manager forces you to deploy on a windows box at the cost of time and frustration? A unix box rings up at about the cost of a windows server licenese.
Some tools were just born for a unix environment. The headache to get them to work in windows isn’t worth it. I”m not going to waste my time trying to get mono to power an asp.net app in apache… why would I force ruby to live in win32.
Please read the articles.. much of it involves proxying to the same box but the principles here do work if you proxy them through a Windows web server to a Linux backend.
Though Linux is probably a better choice, it’s not always about management. Sometimes it’s about resources and supporting an infrastrucutre. Some people just do not have the luxury to use *nix based systems. My hope is that this will be a stepping stone for those who would like to move but need to prove that Ruby on Rails can do what they want. Eventually they may hit a wall and they can use what they learn from these guides to slowly move to Linux as they so desire.
:: puts on his fan boi repellant spray ::
here they come…
Dump MS Virtual Server on your Win2K3 box, create a new linux environment and have a blast.
Jon: The kind of manager who thinks that after you are gone, the next guy won’t know how to administrate a *nix box.
Which is quite likely.
well i appreciate the info and coming from a windows environment myself, I must say that this information is great since my experience in *nix based systems isn’t what it should be (yet). So to have this information so that I can partake in even more Rails fun is great…thanks!
These approaches require the use of a reverse proxy plugin to rails to make it work… As I read it, the plugin could be incorporated into the rails core easily enough, which would improve rails support on any proxy platform. It could easily be turned on or off by a config variable in environment.rb. Any comments from the rails core team?
As for using windows; I’ve been a Linux “zealot” since 1995, but this is truly amazing that we can have a web programming environment that can work equally well on windows, *nix, and Mac.
For me, it’s no longer about the OS, but about the joy of programming. And if it is easier to deploy on windows, it will only increase the joy for those who are stuck on windows.
As a manager, who also loves Ruby/Rails I really welcome the capability to consider using an MS box if I have to – even just the ‘proxy’ing through’ aspect is genuinely valuable. You really can’t rely on the next person having a broad enough range of skills in a samll company – if you do you’re not being a responsible geek!
I’ve had to deploy tiny Rails apps on a windows box running under Webrick, and all kinds of service schenanigans to get it to stay up properly on reboot, etc.
Hopefully all three of the RoR developers who deploy on Windows will appreciate this!
But it’s still a good thing…
What kind of monolothic manager forces you to deploy on a windows box at the cost of time and frustration?
The kind with racks full of Windows servers and 10+ years of experience managing them/ MS technologies but an open enough mind to allow you to try new things.
This couldn’t have been more timely (based on a forum request I just made the other day related to this very topic). Thanks!
You really can’t rely on the next person having a broad enough range of skills in a samll company
I would counter that you can’t afford to be sloppy by hiring people who don’t know how to admin a *nix server in a small company.
Jon: The kind of manager who thinks that after you are gone, the next guy won’t know how to administrate a *nix box.
Which is great if its your Job Security you’re looking after…
Before bashing a useful article like this, ask yourself a few things.
1) Does this article address a problem? 2) Does this article make solving that problem easier?
If this answer is Yes and Yes, regardless of whether or not you’re facing that problem, don’t bash it.
Before bashing a useful article like this, ask yourself a few things.
1) Does this article address a problem? 2) Does this article make solving that problem easier?
If this answer is Yes and Yes, regardless of whether or not you’re facing that problem, don’t bash it.
Been waiting for something like this for a long time. Thanks!
www.walkenclips.com Pure Christopher Walken gold
I’m a rails developer and I use windows (and I fucking love it as much as you love your mac). I bet there are a lot of developers who like to play GTA:SA, you know, bust some shit. And every time one of those contributes to the wonderful RoR community he’s got to hear these evangelical rants about *nix. How original, telling an open source community that you prefer Linux to windows. It’s like wearing the shirt of the band you’re going to see. “Don’t be that guy.” So big ups to Brian and down with the haters. We’re all on the same team here.
I’m a rails developer and I use windows (and I fucking love it as much as you love your mac). I bet there are a lot of developers who like to play GTA:SA, you know, bust some shit. And every time one of those contributes to the wonderful RoR community he’s got to hear these evangelical rants about *nix. How original, telling an open source community that you prefer Linux to windows. It’s like wearing the shirt of the band you’re going to see. “Don’t be that guy.” So big ups to Brian and down with the haters. We’re all on the same team here.
I’m so confused. So why isn’t InstantRails for Windows (which can be found on the download page for Rails) not good enough for Windows enviroments?
It’s totally NOT possible to love Windows as much as a Mac. Anybody that thinks otherwise is just a script kiddie. Stop playing games all the time and go learn something: http://www.youtube.com/watch?v=3QdGt3ix2CQ
Unfortunately some clients insist on a Windows box for deployment. They think it’s easier to manage. That might be true for ASP. I m currently on a project that heaviely does mail stuff, has many db records and hundrets of people will access the system at the same time. They want to run it on a Windows box under IIS and that box is also running other stuff. Well, I made my recommodation to use dedicated unix box. Despite all the other problems, Capistrano is the biggest reason to use a Unix system for deployment. Fortunately deployment is not my problem ;)
I’m working on a similar reverse proxy solution with an automated installer. It should be ready in a couple of weeks.
And quit the zealotry – it’s tired and boring (Mac user by the way).
There may be valid reasons to run a web application on a windows server. For example, if your software relies on a component available for windows only. Sometimes you just don’t have any choise.
Great resources! My company is looking into Rails, but all of our infrastructure is Windows-based. One concern our team has been trying to address is integrated Windows authentication. Any pointers on how to accomplish this? I have failed to find any decent resources that would explain a setup on a Windows box.
One potential option would be compiling mod_auth_kerb on Windows for Apache 2.
Not sure about IIS handling the authentication and passing the credentials to Mongrel (NTLM doesn’t support proxying of credential, correct?).
Anyway, any ideas would be greatly appreciated.
George, (closing the <b> tag I hope….)
InstantRails is great for getting started, but which is its focus. It isn’t so much geared for scalable production environments, although it could easily be tweaked so. For one thing, it does run things as services currently, which isn’t good if you have to restart the server.
We are in the process of considering options that these papers employ, which would make IR more suitable (with a little extra care) for a production environment.
Correction: it does NOT run as services.
Its not about about loving mac, windows linux/unix or whatever. What it is about is the realisation that windows and iis are deeply rooted as part of many companies infrastructures. If you think you are going to roll into a companies IT dept with your cowboy hat and chaps on demanding they change their windows box for a linux box just to host your snazzy ror app, then think again.
This information is extremely valuable and I’m sure it must be a life saver for many developers. Of course I would prefer to roll out ror on linux – its a better solution, but anyone with real clients will know this simply isn’t always possible.
What’s another box to any company? Small beans.
And more importantly, at what companies do they wear cowboy hats and chaps?
Its not about getting another box – its about company culture, something even the most powerful cowboy can’t always change.
Which one of these setups provides the biggest performance advantage? Currently I am running Apache2/fcgi on a win2k3 server and it is dog-slow. I am looking for an alternative but I don’t want to go through each of these examples one-by-one to find out I am in a similar situation.
Which one of these setups provides the biggest performance advantage? Currently I am running Apache2/fcgi on a win2k3 server and it is dog-slow. I am looking for an alternative but I don’t want to go through each of these examples one-by-one to find out I am in a similar situation.
I’m agree wiht to integrate Rails into existing IIS Web infrastructure using Apache plus FastCGI, sure you have your second choice with lighttpd and forget about apache, maybe.
I’m agree wiht to integrate Rails into existing IIS Web infrastructure using Apache plus FastCGI, sure you have your second choice with lighttpd and forget about apache, maybe.
I got the Mogrel/lighty/IssapiRewrite/IIS configuration running and it is FAST. I would like to see abenchmark of all the various configurations though. Has anybody used just fastCGI/IIS/Rails? <http: />
I currently have hosting through www.godaddy.com, I am thinking about putting RoR on it. The only problem is I do not have shell access on my server. Am I screwed, or are there other ways of getting around this. Please let me know, any help would be greatly appreciated.
Thanks. Webs