What's the best way to reconfigure an apache server that's hosting a production site?
The basic workflow I use is as follows:
- Make a test server that's as similar to production as possible
- Reconfigure the test server so it's working the way I want it to
- Wait until it's late at night so traffic is low
- Apply the changes I made to the test server to the production server
- Restart apache, with fingers crossed that it works
- If anything goes wrong, roll back and restart
Because Apache needs things like IP addresses hard coded into its config, it's impossible (really not straightforward) to copy the config files exactly from a test server to production. So there's always a chance that things will go wrong when applying them in production. The thing that drives me completely crazy is that
A single typo in any apache config file takes down all sites hosted on that server!
How do people deal with this on large complex production servers? It seems like there has to be a way to check what a configuration will do, or at least if it's valid, without risking taking down the live site. Suggestions?