# A question, or two?

**URL:** <https://www.ruby-forum.com/t/a-question-or-two/72147>\
**Category:** Rails\
**Created:** [October 14, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147 "2006-10-14T20:20:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/1 "2006-10-14T20:20:20Z")

</div>

While it is my first post I thought I’d say “hello” to everyone, so  
“hi”.

A little run down about me, I’m a junior developer looking at expanding  
my knowledge in programming languages and, in this case, frame works.

I’ve experience in PHP, MySQL, JavaScript and some basic Ruby and RoR.

The main reason for making this post was to ask a question regarding  
rails. Question as followed, a lot of thanks to those that help answer:

I’ve had RoR running for about 3 months on my box and played with it but  
only on a basic level. One thing that has just come apparent to me is  
the fact that to access my rails application I go through port 3000  
like: 192.168.1.1:3000. This gives me access to one rails application  
but what happens if I have more than one? Can I only run one per server  
while using the development server that comes with each rails  
application?

---

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/2 "2006-10-14T20:36:40Z")

</div>

Hi –

On Sat, 14 Oct 2006, Steve Clarke wrote:

> While it is my first post I thought I’d say “hello” to everyone, so  
> “hi”.

Hi!

> the fact that to access my rails application I go through port 3000  
> like: 192.168.1.1:3000. This gives me access to one rails application  
> but what happens if I have more than one? Can I only run one per server  
> while using the development server that comes with each rails  
> application?

It depends on which server you’re using, but all the ones you’re  
likely to use take a command-line argument, probably -p, to give a  
port number – like this:

./script/server webrick -p 3001

or

mongrel\_rails start -p 3001

David

–  
David A. Black | removed\_email\_address@domain.invalid  
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]  
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]  
[1] [Ruby for Rails](http://www.manning.com/black) | [3] [http://www.rubypowerandlight.com](http://www.rubypowerandlight.com)  
[2] [http://dablog.rubypal.com](http://dablog.rubypal.com) | [4] [http://www.rubycentral.org](http://www.rubycentral.org)

---

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/3 "2006-10-14T20:36:42Z")

</div>

On Oct 14, 2006, at 2:20 PM, Steve Clarke wrote:

> I’ve had RoR running for about 3 months on my box and played with  
> it but only on a basic level. One thing that has just come apparent  
> to me is the fact that to access my rails application I go through  
> port 3000 like: 192.168.1.1:3000. This gives me access to one  
> rails application but what happens if I have more than one? Can I  
> only run one per server while using the development server that  
> comes with each rails application?

If you’re starting the server with

script/server

you can use the -p option to choose which port number the server  
starts on. So if you already have one server running on port 3000,  
you can start another on 3001 with

script/server -p 3001

James.

–  
James S.

> **[Processing Greenbelt 2009](https://jystewart.net/2009/09/08/processing-greenbelt-2009/)**
>
> We did, in fact, make a newspaper. The hour or so after my last post were more than a little stressful, but the results (a few typos and a printing hiccup that most certainly wasn’t our fault…

---

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/4 "2006-10-14T22:34:52Z")

</div>

On Oct 14, 2006, at 2:41 PM, Steve Clarke wrote:

> Thanks guys, so what you’re saying is each rails application  
> requires its own port no. for access?

Each server running on a system needs its own port number, and in  
development it’s easiest to run a separate server for each application.

In production, you might do things differently.

James.

---

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 8:41pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/5 "2006-10-14T20:41:35Z")

</div>

Thanks guys, so what you’re saying is each rails application requires  
its own port no. for access?

---

<div class="post-metadata">

**Author:** ![scrozier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Post date:** [October 14, 2006, 10:36pm UTC](https://www.ruby-forum.com/t/a-question-or-two/72147/6 "2006-10-14T22:36:52Z")

</div>

On Oct 14, 2006, at 11:41 AM, Steve Clarke wrote:

> Thanks guys, so what you’re saying is each rails application requires  
> its own port no. for access?

They suggested the simplest ways, for development.

In production, you’ll likely have a static web server (nginx, apache,  
lighttpd)  
providing virtual hosts, serving static, and proxying dynamic  
requests back to  
mongrel. This configuration allows you assign different Rails  
applications to  
different IP address, domain names, URIs, ports, etc.

Suffice it to say that there’s nothing negative inherent in Rails  
with respect  
to deployment.

–  
– Tom M., CTO  
– Engine Y., Ruby on Rails Hosting  
– Reliability, Ease of Use, Scalability  
– (866) 518-YARD (9273)
