# Second App in localhost

**URL:** <https://www.ruby-forum.com/t/second-app-in-localhost/190996>\
**Category:** Rails\
**Created:** [July 2, 2010, 6:36am UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996 "2010-07-02T06:36:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 6:36am UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/1 "2010-07-02T06:36:21Z")

</div>

Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on  
Rails / Apache2 / Passenger

I have one app called “firstapp” hosted in my localhost  
I think i added one entry to apache2.conf file to view this app from the  
browser.

So, now i can access this from the browser 127.0.0.1:3000  
Note: I had a long walk to get this working in my browser.

Now, I am afraid to create my “secondapp”  
Ofcourse, it is simple to run the command “rails secondapp -d mysql”

but can some one please tell me what other commands/files i have to  
run/modify in order to view this in the browser. ( for now , pls ignore  
the models / views / controllers… that will be part of building the  
secondapp… )

which config files i should modify?  
apache2.conf and ??

Can I have both the apps running simultaneously? (probably using  
different ports, since mine is a localhost and uses 127.0.0.1 ip . )

Currenlty using \*:80 for first app.  
Can I use \*:81 for second app?

Can someone summarize it as it overwhelming for me to articulate the  
steps for secondapp setup, in terms of apache2.conf and viewing in  
browser?

thanks,  
radha

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 6:39am UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/2 "2010-07-02T06:39:28Z")

</div>

Ofcourse, my “firstapp” and “secondapp” (both) are ruby on rails apps.

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 9:37pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/3 "2010-07-02T21:37:53Z")

</div>

RailsFan R. wrote:

> Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on  
> Rails / Apache2 / Passenger

I wouldn’t consider this question on-topic for this forum. You’re  
questions aren’t Rails related, but rather Apache & Passenger related.

If you intend to deploy using Apache/Passenger then go find the  
appropriate documentation or forums to set those up correctly.

If you simply want to run two instances of Rails on you local  
(development) box then you can just run them on different ports:

firstapp:  
./script/server (port defaults to 3000)

secondapp  
./script/server -p 3001

In this configuration Apache/Passenger aren’t needed at all. This is  
standard practice for how I run my Rails applications in development.

When it’s time to deploy for other people to use then Apache/Passenger  
is a great way to do that (although not the only way). At this point,  
however, you will need proper domain names for your different sites. No  
user is going to want to have to use any other port besides the default  
80. So to run multiple sites on one box you need to give them either  
different domains or run them under different subdomains.

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 10:42pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/4 "2010-07-02T22:42:59Z")

</div>

Hi Robert,

thanks for your response.  
thanks for clarifying that I don’t have to touch apache and passenger  
for this.  
yes, this is purely for local development purposes only.  
Of course, when I host it externally, i will have separate domain names.

since, i want to create multiple rails apps in my localhost, i want to  
esnure that i am taking atleast a simple path.  
It is a big relief to know that i don’t have to tweak these apache2  
config files.  
thanks a ton!

(and sorry if u felt that this was off topic originally. but i really  
wanted to get the rails developers point of view…as i am on the road to  
developing two different rails apps in my local machine)

- thanks,  
radha.

Robert W. wrote:

> RailsFan R. wrote:
> 
> > Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on  
> > Rails / Apache2 / Passenger
> 
> I wouldn’t consider this question on-topic for this forum. You’re  
> questions aren’t Rails related, but rather Apache & Passenger related.
> 
> If you intend to deploy using Apache/Passenger then go find the  
> appropriate documentation or forums to set those up correctly.
> 
> If you simply want to run two instances of Rails on you local  
> (development) box then you can just run them on different ports:
> 
> firstapp:  
> ./script/server (port defaults to 3000)
> 
> secondapp  
> ./script/server -p 3001
> 
> In this configuration Apache/Passenger aren’t needed at all. This is  
> standard practice for how I run my Rails applications in development.
> 
> When it’s time to deploy for other people to use then Apache/Passenger  
> is a great way to do that (although not the only way). At this point,  
> however, you will need proper domain names for your different sites. No  
> user is going to want to have to use any other port besides the default  
> 80. So to run multiple sites on one box you need to give them either  
> different domains or run them under different subdomains.

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 10:50pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/5 "2010-07-02T22:50:44Z")

</div>

I have this apache2/passenger / rails stable version stack running in  
ubuntu.  
Do u think i could change to mongrel\_rails now ?

Michael P. wrote:

> On 2 July 2010 21:42, RailsFan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > yes, this is purely for local development purposes only.  
> > Of course, when I host it externally, i will have separate domain names.
> 
> For developing I just use “mongrel\_rails” locally… no messing around  
> with apache configurations, and easy to specify which port number to  
> start on, so several instances can run at once (and another running  
> through Netbeans for breakpoint debugging).

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/6 "2010-07-02T22:47:40Z")

</div>

On 2 July 2010 21:42, RailsFan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> yes, this is purely for local development purposes only.  
> Of course, when I host it externally, i will have separate domain names.

For developing I just use “mongrel\_rails” locally… no messing around  
with apache configurations, and easy to specify which port number to  
start on, so several instances can run at once (and another running  
through Netbeans for breakpoint debugging).

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 10:51pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/7 "2010-07-02T22:51:48Z")

</div>

Update: I have only couple of sample rails apps running in this stack.  
How easy/tough it is to switch from apache2/passenger to mongrel rails?

thanks,  
radha

RailsFan R. wrote:

> I have this apache2/passenger / rails stable version stack running in  
> ubuntu.  
> Do u think i could change to mongrel\_rails now ?
> 
> Michael P. wrote:
> 
> > On 2 July 2010 21:42, RailsFan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > yes, this is purely for local development purposes only.  
> > > Of course, when I host it externally, i will have separate domain names.
> > 
> > For developing I just use “mongrel\_rails” locally… no messing around  
> > with apache configurations, and easy to specify which port number to  
> > start on, so several instances can run at once (and another running  
> > through Netbeans for breakpoint debugging).

---

<div class="post-metadata">

**Author:** ![railsfan\_radha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Post date:** [July 2, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996/8 "2010-07-02T22:55:52Z")

</div>

On Fri, Jul 2, 2010 at 1:51 PM, RailsFan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> How easy/tough it is to switch from apache2/passenger to mongrel rails?

sudo gem install mongrel  
cd example\_app  
script/server

That should pretty much do it 🙂

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
