# Development and production running simultaneously?

**URL:** <https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100>\
**Category:** Rails\
**Created:** [May 10, 2006, 8:07am UTC](https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100 "2006-05-10T08:07:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbayona](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sbayona](https://www.ruby-forum.com/u/sbayona)\
**Post date:** [May 10, 2006, 8:07am UTC](https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100/1 "2006-05-10T08:07:31Z")

</div>

I’d like to be able to run both development and production as follows:

[www.mysite.com](http://www.mysite.com) will be running production  
[dev.mysite.com](http://dev.mysite.com) will be running development

It should run the same code base. The server is RedHat Enterprise 3,  
Apache, FastCgi.

My problem is I don’t know where to set the environment so the  
application bootstraps depending on the virtual host (www/dev).

I’d really appreciate if someone can point me in the right direction.

Thanks,  
Serge

---

<div class="post-metadata">

**Author:** ![sbayona](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sbayona](https://www.ruby-forum.com/u/sbayona)\
**Post date:** [May 10, 2006, 5:11pm UTC](https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100/2 "2006-05-10T17:11:59Z")

</div>

This seems like a bad idea to me. Isn’t the development code always  
going to have a newer code base than production? Ideally you want to  
keep your development and production environments totally separate in  
order to avoid accidentally putting development level code into  
production.

It’s easy enough to maintain two separate sets of the config files, one  
for development and one for production, and use the correct ones for the  
environment you’re deploying to.

Ken

---

<div class="post-metadata">

**Author:** ![sbayona](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sbayona](https://www.ruby-forum.com/u/sbayona)\
**Post date:** [May 10, 2006, 6:46pm UTC](https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100/3 "2006-05-10T18:46:03Z")

</div>

I don’t understand how you can run production and development  
simultanously.  
Are you developing at a datacenter right in front of your production box  
?  
Or are you hosting at your office and have a big pipe coming in ?

---

<div class="post-metadata">

**Author:** ![sbayona](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sbayona](https://www.ruby-forum.com/u/sbayona)\
**Post date:** [May 10, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/development-and-production-running-simultaneously/60100/4 "2006-05-10T18:53:14Z")

</div>

> My problem is I don’t know where to set the environment so the  
> application bootstraps depending on the virtual host (www/dev).

This is definitely the hard way to make it work. Check out another copy  
of your app into another folder (like …/mysite/dev) and set up a  
virtual host in Apache. If for some reason you really want to use the  
same code in two places, you could check out the common parts into one  
directory, then make symlinks to those directories in “fake” rails  
folders, having individual config files.
