views:

70

answers:

3

Hi,

As Rails applications default run on port 3000, would it be possible to start the application on port 80? Is it really required to have a fastcgi/mod_proxy enabled web server in front? My users won't be more than three at a time. If so, how would I be able to do so?

Thanks!

+2  A: 

WARNING: This is not a general purpose description of how to set up a Ruby on Rails production environment. If you want to host a public Rails website, I highly recommend using Apache with Passenger, which is very easy to install and maintain.

From your description, it sounds like you are working with some kind of internal application to be used within your office or similar. For this particular purpose, hosting the application via Webrick (the built-in web server in Rails) might be a sufficient solution. To do this, start the server with a -p command line argument: ruby script/server -p 80

This obviously requires port 80 to be available (not bound by some other web server). Also, on most operating systems, you will need root privileges to bind to port 80. The security implications of running a web site as root are serious, so you really only want to do this if you know what you are doing, and are absolutely sure that the server is completely shielded from the Internet.

Jørn Schou-Rode
@Shyam, You'll also need to make sure apache or some other service isn't running on port 80 of the server, or this will error.
Tim Snowhite
You will also need root privileges to be able to bind to port 80 (or any other below 1024).
Tomas Markauskas
I second @Tomas argument in a way that I even strongly suggest against doing this. Do not run your rails application as root. Go with the passenger way, it is easy and fast.
hurikhan77
@hur: In most situations I can only agree, but I still believe my answer is the right for this particular question. To avoid confusion, I have now added several disclaimers.
Jørn Schou-Rode
+2  A: 

If there isn't some specific reason you're trying to run with mongrel, I would recommend using Phusion Passenger as it is significantly easier to configure and support than mod_proxy+mongrel.

Mike Buckbee
I think running passenger would require running apache though, which is what the poster is trying to avoid.
Pete Hodgson
A: 
ohho