Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As a beginner, I finally noticed the issue with making changes to the live server I've been working on, now that I have a couple users on it, since I bring it down so often.

I created an EC2 image of my live server and set up a separate instance on EC2, so now I have 2 EC2 instances, Stage and Production. I set up GitHub and push changes to stage and test my code there, and when it's all done and working, I push it to the production branch, and everything is good. And there is a slight issue here since I name my files config_stage.js and config_production.js and set up .gitignore on each server, and in my code, I would have it read the ENV flags and set up the appropriate configs, is this the correct approach?

And my main question is: how do you keep track of non-code changes to the server? For example, I installed HAProxy, Stunnel, Redis, MongoDB and several other things onto the Stage server for testing and now that it's all working and good, how do I deploy them to production? Right now, I'm just keeping track of everything I installed and copying configuration files over, which is very tedious and I'm afraid I may have missed a step somewhere.

Is there a better way to port these changes over from my test server to my live server?

share|improve this question

migrated from webmasters.stackexchange.com Oct 15 '12 at 15:11

1 Answer

Regarding config files, that is definitely the right approach - one for each environment.

As for making server changes, there are two different approaches that we take:

  1. Swap the servers from stage to production. This is an extremely common practice. Once the stage server is setup and working - make it live. If you have a load balancer in front or elastic IP, you can simply update it to point to the stage server instead of the live server.

  2. Build a script that will "stand-up" servers. Something like Chef Deploy will help with that. This way, you setup your staging server using the script and once happy with it apply it to live.

At the end if you have the time, I would do a combination of both.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.