Running Webrick alongside IIS on port 80

P

Prashant Deva

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

Robert Klemme

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
 
J

James Britt

Prashant said:
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/index.html

which could maybe be used as an ASP language.


--
James Britt

http://www.ruby-doc.org - Ruby Help & Documentation
http://beginningruby.com - Beginning Ruby: The Online Book
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 
R

Ron M

Robert said:
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.
 
R

Robert Klemme

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
 
H

Hassan Schroeder

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

Robert Worley

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.isapirewrite.com/. 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.
 
M

mathsfan

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

mathsfan

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

Alex Young

James said:
Prashant said:
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/index.html

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top