# Moving to production

**URL:** <https://discuss.rubyonrails.org/t/moving-to-production/11621>\
**Category:** rubyonrails-talk\
**Created:** [April 12, 2007, 11:58pm UTC](https://discuss.rubyonrails.org/t/moving-to-production/11621 "2007-04-12T23:58:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skrinak](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Skrinak](https://discuss.rubyonrails.org/u/Skrinak)\
**Post date:** [April 12, 2007, 11:58pm UTC](https://discuss.rubyonrails.org/t/moving-to-production/11621/1 "2007-04-12T23:58:59Z")

</div>

How do you configure apache on red hat linux 'the proper way' for production? There's an intriguing line in config/envinronment.rb:

# Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way ENV['RAILS\_ENV'] ||= 'production'

I've spent most of the day looking for this 'proper way'. Can any guide me to this mysterious place?

---

<div class="post-metadata">

**Author:** ![Skrinak](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Skrinak](https://discuss.rubyonrails.org/u/Skrinak)\
**Post date:** [April 18, 2007, 3:10am UTC](https://discuss.rubyonrails.org/t/moving-to-production/11621/2 "2007-04-18T03:10:58Z")

</div>

Thank you!

BTW, where did you find that documented?

Kris

---

<div class="post-metadata">

**Author:** ![Niels\_Meersschaert](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@Niels\_Meersschaert](https://discuss.rubyonrails.org/u/Niels_Meersschaert)\
**Post date:** [April 18, 2007, 12:52pm UTC](https://discuss.rubyonrails.org/t/moving-to-production/11621/3 "2007-04-18T12:52:17Z")

</div>

To do the migration, you don't need to edit the environment files at  
all. Otherwise you'll be editing those on both your dev & prod  
environments with every deploy (which is a BadThing®). Instead, you  
can run your migration on the production database by calling rake  
db:migrate RAILS\_ENV=production. For quick testing you can even use  
script/console production.

When you start your server you pass it the environment flag (works  
for webbrick, mongrel, etc)

Cheers,

Niels
