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:

Cheers to Brian for sharing the fruits of his labor.

Posted in Documentation | 36 comments

Comments

  1. Jon Maddox on 11 May 15:16:

    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.

  2. Brian Hogan on 11 May 15:25:

    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.

  3. Jake Good on 11 May 15:34:

    :: puts on his fan boi repellant spray ::

    here they come…

  4. James Thompson on 11 May 15:46:

    Dump MS Virtual Server on your Win2K3 box, create a new linux environment and have a blast.

  5. Adam Sanderson on 11 May 15:59:

    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.

  6. noobonrails on 11 May 16:44:

    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!

  7. DGM on 11 May 17:07:

    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.

  8. Jeremy Garside on 11 May 17:09:

    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!

  9. Shanti Braford on 11 May 18:06:

    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.

  10. Joe on 11 May 18:27:

    Hopefully all three of the RoR developers who deploy on Windows will appreciate this!

    But it’s still a good thing…

  11. Tom on 11 May 18:59:

    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.

  12. http://billy-girlardo.com/WP/ on 11 May 19:29:

    This couldn’t have been more timely (based on a forum request I just made the other day related to this very topic). Thanks!

  13. anon on 11 May 19:33:

    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.

  14. Will Green on 11 May 20:14:

    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…

  15. Jack Straw on 11 May 22:38:

    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.

  16. Jack Straw on 11 May 22:38:

    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.

  17. Bill on 12 May 03:32:

    Been waiting for something like this for a long time. Thanks!

    www.walkenclips.com Pure Christopher Walken gold

  18. Avi Flombaum on 12 May 05:00:

    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.

  19. Avi Flombaum on 12 May 05:00:

    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.

  20. George on 12 May 05:37:

    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?

  21. Joe on 12 May 07:32:

    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

  22. Adi on 12 May 08:05:

    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 ;)

  23. Rahoul Baruah on 12 May 12:45:

    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).

  24. Vlad on 12 May 13:33:

    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.

  25. shawn@dahlen.name on 12 May 14:08:

    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.

  26. DGM on 12 May 14:20:

    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.

  27. DGM on 12 May 14:21:

    Correction: it does NOT run as services.

  28. dave on 12 May 18:45:

    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.

  29. Joe on 12 May 20:34:

    What’s another box to any company? Small beans.

    And more importantly, at what companies do they wear cowboy hats and chaps?

  30. dave on 12 May 21:11:

    Its not about getting another box – its about company culture, something even the most powerful cowboy can’t always change.

  31. spurton on 19 May 16:57:

    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.

  32. spurton on 19 May 18:35:

    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.

  33. nigel on 31 May 22:09:

    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.

  34. nigel on 31 May 22:11:

    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.

  35. Shawn on 20 Jun 16:16:
    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: />
  36. Webs on 22 Jun 20:39:

    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