Forum: Ruby on Rails Rails on IIS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Adam Carheden (Guest)
on 2006-04-05 02:42
I just spent the last two days trying to get Rails on IIS to work with
Windows 2003/IIS 6.0. I think I've finally got it working, but it took
more googling than I care to describe. Now I've got a few questions:

1) Is there some 'official' Rails on IIS guide on this site on another
official ruby site that's known to work well?
2) If not, can someone make one using my links/notes below?
3) What is the latest version of request.rb with the necessary hack for
IIS that actually works? (see notes below).

My notes/links:
- This was the best tutorial I found:
http://made-of-stone.blogspot.com/2006/01/rails-on....
It was incomplete though. Use my notes below as well. Also, it didn't
really describe how to install rails in <myapp>/vendor, so I just
modified request.rb in C:\ruby\... Note that the mods are the ones I
described below. If you've got a recent version of rails, your
requests.rb will be the same as in this tutorial but still won't work.

- I kept getting 403 errors until I followed these instructions
(http://www.beamartyr.net/articles/iisperl.html) for setting up Perl
with IIS. Basically, you give the user account some extra user rights.

- Don't forget to make all the dll's and .exe's described executable to
whatever user your IIS app pool is running as, and make the
IconicIsapiRewrite and <myapp>/log directories writeable.

- Even though I just downloaded my version of Rails (1.1.0 per
scripts/about) using gems, and the file notes that it includes an IIS
hack, I had to modify request.rb as described here at
http://colinramsay.co.uk/diary/archives/000297.html. What's more, even
that didn't work. I had to replace the return (uri) in request_uri with
'uri.sub(/^\/\//, "/")'.
Erwin Q. (Guest)
on 2006-04-05 05:03
(Received via mailing list)
Adam Carheden wrote:
> My notes/links:
> with IIS. Basically, you give the user account some extra user rights.
> 'uri.sub(/^\/\//, "/")'.
>
>
Hi Adam,

    I've been looking for solutions on how to get ror working on IIS too
but same as you... I haven't found any good step by step info how to set
it up.

This is a big stopper for people wanting to try out rails... if you
happen to make it work. please let me know...

thanks,

Erwin Q.
Bolo M. (Guest)
on 2006-04-05 15:14
(Received via mailing list)
Me too I seek a solution more simple for windows 2K/IIS 5
I have a server dedicated and i can't use it

2006/4/4, Erwin Q. <removed_email_address@domain.invalid>:
Mathieu C. (Guest)
on 2006-04-05 16:49
(Received via mailing list)
Thanks for this IIS BestOf <grin>

During my IIS6 setup I've also used this link

http://phplens.com/phpeverywhere/fastcgi-php

Background infos about FastCGI are also valuables for Ror.
Bolo M. (Guest)
on 2006-04-05 17:05
(Received via mailing list)
it's same thing for IIS 5. 'Cause i seek some infos for my network
Design.


2006/4/5, Mathieu C. <removed_email_address@domain.invalid>:
Alan F. (Guest)
on 2006-04-05 18:24
Adam Carheden wrote:
> I just spent the last two days trying to get Rails on IIS to work with
> Windows 2003/IIS 6.0. I think I've finally got it working, but it took
> more googling than I care to describe. Now I've got a few questions:
>
> 1) Is there some 'official' Rails on IIS guide on this site on another
> official ruby site that's known to work well?
> 2) If not, can someone make one using my links/notes below?

Hi Adam,

Why not post it to the wiki.  That way it might just 'become' the
official Rails on IIS guide.  What would you do amend, update or
replace:

http://wiki.rubyonrails.com/rails/pages/HowtoSetupIIS

Alan
Brian H. (Guest)
on 2006-04-05 18:59
(Received via mailing list)
My experience with this is don't bother. Apache is easy to set up behind
IIS. You can forward requests using ISAPI Rewrite and nobody will know
the
difference.

We are using this now and we are a windows shop. Eventually we'll
implement
ISA server as our proxy.
Mathieu C. (Guest)
on 2006-04-05 19:20
(Received via mailing list)
Hello Brian,

> My experience with this is don't bother. Apache is easy to set up behind
> IIS. You can forward requests using ISAPI Rewrite and nobody will know the
> difference.

Would you share your Rewrite httpd.ini please, I'll like to have a
backup plan like this but using Mongrel.

Thanks
Brian H. (Guest)
on 2006-04-05 19:26
(Received via mailing list)
Can't right now but search the list... I've posted howtos on this a few
times. If you still can't find it, remind me later and when I get a
moment
I'll post it again
Brian H. (Guest)
on 2006-04-05 19:29
(Received via mailing list)
Oh and Mongrel is a pain on Windows.. Apache is still better because you
can
easily manage your assets (Apache can use rewrite base so I can mount
apps
to a subfolder as opposed to a separate host. I have not been able to
make
that work with Mongrel yet. Plus it seems to run slower on Windows than
Apache (in my tests) but Ruby on Windows is slow anyway (compared to
Linux)
Bolo M. (Guest)
on 2006-04-06 00:57
(Received via mailing list)
Sorry for my 'dump' question.
If setup RoR on my IIS sever , after i can use dotNet ? there is no
problem
between dotNet and Ruby ?

2006/4/5, Brian H. <removed_email_address@domain.invalid>:
zdennis (Guest)
on 2006-04-06 01:13
(Received via mailing list)
Erwin Q. wrote:
>>
>> (http://www.beamartyr.net/articles/iisperl.html) for setting up Perl
>> that didn't work. I had to replace the return (uri) in request_uri
> happen to make it work. please let me know...
>

Any particular reason you want to run IIS? It seems odd. I have never
seen such a thing.

Zach
zdennis (Guest)
on 2006-04-06 01:19
(Received via mailing list)
Brian H. wrote:
> Oh and Mongrel is a pain on Windows..

It can be made easy. go to vmware.com and download the free player, then
download a community built appliance (perhaps Fedora or Debian) and
install Mongrel there. =)

Zach
Bolo M. (Guest)
on 2006-04-06 01:28
(Received via mailing list)
For Me , i have yet a server dedicated for my dotNet application.
I don't want buy an other.

2006/4/5, zdennis <removed_email_address@domain.invalid>:
Brian H. (Guest)
on 2006-04-06 16:06
(Received via mailing list)
That's cheating! :)
Bolo M. (Guest)
on 2006-04-06 16:28
(Received via mailing list)
lol

if i can use RoR on IIS , i can also use a linux sever with mono :p
It' an other solution :D

Bolo
2006/4/6, Brian H. <removed_email_address@domain.invalid>:
Zed S. (Guest)
on 2006-04-07 23:21
(Received via mailing list)
Hey Brian,

Curious what kind of ³pain² you¹re seeing on Windows.  If you can give
me
some feedback I¹ll roll it into the 0.4 release when I reconcile how the
POSIX and Windows worlds work for Mongrel.

Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/
Brian H. (Guest)
on 2006-04-08 01:01
(Received via mailing list)
Zed:

There are two issues... one of which I don't think you can fix because I
think it's related directly to ruby on windows.  The issue is basically
that
there is no difference in performance whether you use Apache+FCGI,
Apache+SCGI, or other approaches.   According to HTTPerf and other
tools,
the req/second are all roughly the same.... about 5 times slower than on
Linux.

The other issue is relative URLs, assets, and other minor things that
can
get irritating. (I don't think it's just Windows).

Mongrel is awesome if you just want to serve one Rails site using its
own
port or its own vhost. But not so good for integrating with another web
server (one that sucks as bad as IIS).

Let's say I would like to deploy an application at /chemistry/labs/
instead
of /

(The reason I would want to do this is because IIS doesn't have the
ability
to do reverse proxying... so I need to have the path from the front-side
server equal to the path on Mongrel so I can do some clean mapping
between
the servers.)

What I do with Apache is simply apply a RewriteBase attribute in the
.htaccess file and set it to /chemistry/labs/
Then www.uwec.edu/chemistry/labs  easily forwards to
internal.uwec.edu:3000/chemistry/labs  and I don't have any issues with
relative URLS being generated by the Rails program. )

With Mongrel, I can't really do that, so I tried setting a value for
request_uri

ActionController::AbstractRequest.relative_url_root = "/chemistry/labs'

And this works remarkably well, except for one small problem......
images,
stylesheets, and javascript files no longer work :) The URLS are
rewritten
correctly, but they are still served out of the public folder

In this case, requests to /chemistry/labs/images/ are returned as 404
errors.... but /images  returns correctly.

This is basically the only issue we have found with this software and
we've
found no way around it.  However, I don't think it's a show-stopper; it
just
means that we can't use it in the way we'd like.

Again, this is trivial. It would be great if there was a way this could
be
solved... some config setting or something. Mongrel is exactly what we
need
in our environment. However, don't break your neck over this just
because we
would find it useful.

I probably should have phrased "pain on windows" differently.
frazer horn (Guest)
on 2006-04-08 01:38
(Received via mailing list)
Hi Zed
I have seen various tutorials on setting up ror on iis - I havn't tried
any
at this stage.  However, in a month or so I need to roll out a re
written
jboss/j2ee(running through iis isapi tomcat redirector)  application in
ror
on windows/iis.  It is only going to be supporting 20 users max so I'm
confident iis/mongrel or fcgi would be ok.

I would like to use mongrel (its functioning well on our dev server) but
do
not have much of a clue where to start.  Is it possible?  I think its
fair
to say windows will not provide the performance of linux but a simple
install process would go a long way.  Unfortunately IIS is widely used!!

Is it possible to run mongrel with iis?

Cheers

Frazer
Zed S. (Guest)
on 2006-04-08 23:24
(Received via mailing list)
Well, simplest way would be to run mongrel and IIS behind pound:

  http://www.apsis.ch/pound/

Even gives you WebDAV through the proxy and easy SSL setup.

When you set it up you actually have IIS and X number of Mongrels on the
same level.  So instead of:

  IIS -> [mongrel1, mongrel2, mongrel3]

You do:

  pound -> [IIS, mongrel1, mongrel2, mongrel3]

Then pound looks at cookies and request URIs to determine how to route
the
requests.

Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/
frazer horn (Guest)
on 2006-04-09 01:26
(Received via mailing list)
Thanks Zed, I think you have mentioned this before.  Is their any
further
info available on setting up pound on windows with iis.

Thanks
Wayne D. (Guest)
on 2007-03-04 01:16
Brian H. wrote:
> My experience with this is don't bother. Apache is easy to set up behind
> IIS. You can forward requests using ISAPI Rewrite and nobody will know
> the
> difference.
>
> We are using this now and we are a windows shop. Eventually we'll
> implement
> ISA server as our proxy.

can you run virtual hosts with mongrel or webrick? I know how to setup
virtual host in Apache2 but no clue how to setup mongrel. Let me know
please.
Thank you,

Wayne
This topic is locked and can not be replied to.