[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Running Webrick alongside IIS on port 80

Prashant Deva

1/12/2007 10:47:00 PM

Hi,
I am hosting a couple of asp.net sites on IIS on my server.

Now I need to host another site in ruby on the same machine. For this I
guess i will need to run the webrick server.

Can anyone tell me how to have both iis and webrick running on port 80,
otherwise people will need to add the port 3000 to the site name each
time they visit the ruby site.

--
Posted via http://www.ruby-....

9 Answers

Robert Klemme

1/12/2007 11:16:00 PM

0

On 12.01.2007 23:47, Prashant Deva wrote:
> Hi,
> I am hosting a couple of asp.net sites on IIS on my server.
>
> Now I need to host another site in ruby on the same machine. For this I
> guess i will need to run the webrick server.
>
> Can anyone tell me how to have both iis and webrick running on port 80,
> otherwise people will need to add the port 3000 to the site name each
> time they visit the ruby site.

Um, you cannot have to processes listen on the same port on one
interface. You either have to resort to using a different port with
WebRick (hopefully this is not a production server) or you make IIS
serve Ruby code. You can certainly do this with CGI. I do not know
whether there is better (faster) integration available for this web
server (FastCGI?). Another solution is to configure a redirect in IIS
that sends certain URL's off to the WebRick server on another port.
Lots of options...

Kind regards

robert

James Britt

1/13/2007 12:49:00 AM

0

Prashant Deva wrote:
> Hi,
> I am hosting a couple of asp.net sites on IIS on my server.
>
> Now I need to host another site in ruby on the same machine. For this I
> guess i will need to run the webrick server.

No. There are several options for hosting Ruby code. Plain CGI or
FastCGI + [apache|lighhtp], or Mongrel, perhaps.

Or IIS. It can server Ruby up as CGI, I believe.

There's also ActiveScriptRuby:

http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/...

which could maybe be used as an ASP language.


--
James Britt

http://www.ru... - Ruby Help & Documentation
http://beginni... - Beginning Ruby: The Online Book
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.jame... - Playing with Better Toys

Ron M

1/13/2007 3:18:00 PM

0

Robert Klemme wrote:
> On 12.01.2007 23:47, Prashant Deva wrote:
>> Can anyone tell me how to have both iis and webrick running on port 80,
>> otherwise people will need to add the port 3000 to the site name each
>> time they visit the ruby site.
>
> Um, you cannot have to processes listen on the same port on one
> interface.

Sure you can. You can if you give the interface card 2 IP addresses
and have each process only listen to port 80 on one of the IPs.
I don't know how to do this in IIS; but Apache's docs describe
in their "Setting up multiple daemons" daemons section. I assume
webrick offers similar? Or are you considering this a different port?

> You either have to resort to using a different port with
> WebRick (hopefully this is not a production server) or you make IIS
> serve Ruby code. You can certainly do this with CGI. I do not know
> whether there is better (faster) integration available for this web
> server (FastCGI?). Another solution is to configure a redirect in IIS
> that sends certain URL's off to the WebRick server on another port. Lots
> of options...

I'd say his easiest alternative is to run Apache on port 80; and
have it proxy some requests to some ruby server (hopefully better
than webrick - maybe mongrel) and proxy other requests to IIS running
on a different port. And then firewall off the IIS and webrick ports
of course for security reasons.



Robert Klemme

1/13/2007 7:12:00 PM

0

On 13.01.2007 16:17, Ron M wrote:
> Robert Klemme wrote:
>> On 12.01.2007 23:47, Prashant Deva wrote:
>>> Can anyone tell me how to have both iis and webrick running on port 80,
>>> otherwise people will need to add the port 3000 to the site name each
>>> time they visit the ruby site.
>> Um, you cannot have to processes listen on the same port on one
>> interface.
>
> Sure you can. You can if you give the interface card 2 IP addresses
> and have each process only listen to port 80 on one of the IPs.

You actually can have *two* IP addresses on *one* NIC? Are you sure
about that? How would you configure that for example on Linux?

> I don't know how to do this in IIS; but Apache's docs describe
> in their "Setting up multiple daemons" daemons section. I assume
> webrick offers similar? Or are you considering this a different port?

Even if IIS and Webrick both support binding to just one IP address
(which I assume) then you still need two DNS names - one for each IP.
The OP did not sound as if that was what he wanted - if it's possible
at all. Of course you could map one DNS name to both IP's but this
might yield unpredictable results.

> I'd say his easiest alternative is to run Apache on port 80; and
> have it proxy some requests to some ruby server (hopefully better
> than webrick - maybe mongrel) and proxy other requests to IIS running
> on a different port. And then firewall off the IIS and webrick ports
> of course for security reasons.

I'd say the *easiest* is to just run Ruby code via CGI - or just have
Webrick run on another port. With your setup you have three pieces of
software to configure, run and monitor vs. two in the other case.

Regards

robert

Hassan Schroeder

1/13/2007 8:11:00 PM

0

On 1/13/07, Robert Klemme <shortcutter@googlemail.com> wrote:

> You actually can have *two* IP addresses on *one* NIC? Are you sure
> about that? How would you configure that for example on Linux?

man ifconfig :-)

> Even if IIS and Webrick both support binding to just one IP address
> (which I assume) then you still need two DNS names - one for each IP.
> The OP did not sound as if that was what he wanted - if it's possible
> at all.

Actually, the OP said "Now I need to host another site..." which to me
implies a unique host/domain name. So it would be easy to have his
existing ASP sites mapped to one IP and the Ruby site to another.

FWIW, my dev machines (SuSE currently, Windows in the past) always
have multiple IPs configured so I can run different server types/versions
simultaneously for testing...

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Robert Worley

1/14/2007 10:23:00 AM

0

It's not possible to have both IIS and webrick listen on port 80. You
might want to look into configuring IIS to proxy requests to webrick
using something like this: http://www.isapire.... That way your
users will be able to connect through IIS to webrick without having to
specifiy a port in the URL. If you google for "rails ISAPI_Rewrite" you
should be able to find the info you need.

--
Posted via http://www.ruby-....

mathsfan

1/14/2007 10:25:00 AM

0

Maybe this can help you :
First,stop you iis,then start webrick like this:ruby script/server -p
80
Hassan Schroeder wrote:
> On 1/13/07, Robert Klemme <shortcutter@googlemail.com> wrote:
>
> > You actually can have *two* IP addresses on *one* NIC? Are you sure
> > about that? How would you configure that for example on Linux?
>
> man ifconfig :-)
>
> > Even if IIS and Webrick both support binding to just one IP address
> > (which I assume) then you still need two DNS names - one for each IP.
> > The OP did not sound as if that was what he wanted - if it's possible
> > at all.
>
> Actually, the OP said "Now I need to host another site..." which to me
> implies a unique host/domain name. So it would be easy to have his
> existing ASP sites mapped to one IP and the Ruby site to another.
>
> FWIW, my dev machines (SuSE currently, Windows in the past) always
> have multiple IPs configured so I can run different server types/versions
> simultaneously for testing...
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

mathsfan

1/14/2007 10:28:00 AM

0

Maybe this can help you :
First,stop you iis,then start webrick like this:ruby script/server -p
80
Hassan Schroeder wrote:

Alex Young

1/14/2007 11:28:00 AM

0

James Britt wrote:
> Prashant Deva wrote:
>> Hi,
>> I am hosting a couple of asp.net sites on IIS on my server.
>>
>> Now I need to host another site in ruby on the same machine. For this I
>> guess i will need to run the webrick server.
>
> No. There are several options for hosting Ruby code. Plain CGI or
> FastCGI + [apache|lighhtp], or Mongrel, perhaps.
>
> Or IIS. It can server Ruby up as CGI, I believe.
>
> There's also ActiveScriptRuby:
>
> http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/...
>
> which could maybe be used as an ASP language.
>
>
How's this for an idea: run Mongrel on port 80, and proxy requests that
aren't for the Ruby site to IIS on another port? I presume IIS can't be
configured to proxy the same way that Apache can, so why not do it the
other way around?

--
Alex